@@ -14,7 +14,7 @@ registerMooseObject("MooseApp", LinearFVAdvectionDiffusionFunctorRobinBC);
1414InputParameters
1515LinearFVAdvectionDiffusionFunctorRobinBC ::validParams ()
1616{
17- InputParameters params = LinearFVAdvectionDiffusionBC ::validParams ();
17+ InputParameters params = LinearFVAdvectionDiffusionFunctorRobinBCBase ::validParams ();
1818 params .addClassDescription (
1919 "Adds a Robin BC of the form \\alpha * \\nabla \\phi*n + \\beta * \\phi = \\gamma, "
2020 "which can be used for the assembly of linear "
@@ -31,7 +31,7 @@ LinearFVAdvectionDiffusionFunctorRobinBC::validParams()
3131
3232LinearFVAdvectionDiffusionFunctorRobinBC ::LinearFVAdvectionDiffusionFunctorRobinBC (
3333 const InputParameters & parameters )
34- : LinearFVAdvectionDiffusionBC (parameters ),
34+ : LinearFVAdvectionDiffusionFunctorRobinBCBase (parameters ),
3535 _alpha (getFunctor < Real > ("alpha" )),
3636 _beta (getFunctor < Real > ("beta" )),
3737 _gamma (getFunctor < Real > ("gamma" ))
@@ -67,125 +67,3 @@ LinearFVAdvectionDiffusionFunctorRobinBC::getGamma(Moose::FaceArg face, Moose::S
6767{
6868 return _gamma (face , state );
6969}
70-
71- Real
72- LinearFVAdvectionDiffusionFunctorRobinBC ::computeBoundaryValue () const
73- {
74- const auto face = singleSidedFaceArg (_current_face_info );
75- mooseAssert (_current_face_type != FaceInfo ::VarFaceNeighbors ::BOTH ,
76- "This should not be assigned on an internal face!" );
77- const auto & elem_info = _current_face_type == FaceInfo ::VarFaceNeighbors ::ELEM
78- ? _current_face_info -> elemInfo ()
79- : _current_face_info -> neighborInfo ();
80- const auto state = determineState ();
81-
82- const auto alpha = getAlpha (face , state );
83- const auto beta = getBeta (face , state );
84- const auto gamma = getGamma (face , state );
85-
86- const auto phi = _var .getElemValue (* elem_info , state );
87- const auto grad_phi = _var .gradSln (* elem_info );
88-
89- const auto & nhat = _current_face_info -> normal ();
90-
91- const auto d_cf = computeCellToFaceVector (); // vector from boundary cell centre to boundary face
92- const auto projection = d_cf * nhat ;
93- const auto vc = d_cf - (projection * nhat );
94- return ((alpha * phi ) + (alpha * grad_phi * vc ) + (gamma * projection )) /
95- (alpha + (beta * projection ));
96- }
97-
98- Real
99- LinearFVAdvectionDiffusionFunctorRobinBC ::computeBoundaryNormalGradient () const
100- {
101- const auto face = singleSidedFaceArg (_current_face_info );
102- const auto state = determineState ();
103- const auto alpha = getAlpha (face , state );
104- mooseAssert (!MooseUtils ::isZero (alpha ), "Alpha should not be 0!" );
105- const auto beta = _beta (face , state );
106- const auto gamma = _gamma (face , state );
107- return (gamma - beta * computeBoundaryValue ()) / alpha ;
108- }
109-
110- // implicit terms for advection kernel
111- Real
112- LinearFVAdvectionDiffusionFunctorRobinBC ::computeBoundaryValueMatrixContribution () const
113- {
114- const auto face = singleSidedFaceArg (_current_face_info );
115- const auto state = determineState ();
116- const auto alpha = getAlpha (face , state );
117- const auto beta = getBeta (face , state );
118- const auto & nhat = _current_face_info -> normal ();
119-
120- return alpha / (alpha + (beta * computeCellToFaceVector () * nhat ));
121- }
122-
123- // explicit terms for advection kernel
124- Real
125- LinearFVAdvectionDiffusionFunctorRobinBC ::computeBoundaryValueRHSContribution () const
126- {
127- const auto face = singleSidedFaceArg (_current_face_info );
128- const auto state = determineState ();
129- mooseAssert (_current_face_type != FaceInfo ::VarFaceNeighbors ::BOTH ,
130- "This should not be assigned on an internal face!" );
131- const auto & elem_info = _current_face_type == FaceInfo ::VarFaceNeighbors ::ELEM
132- ? _current_face_info -> elemInfo ()
133- : _current_face_info -> neighborInfo ();
134-
135- const auto alpha = getAlpha (face , state );
136- const auto beta = getBeta (face , state );
137- const auto gamma = getGamma (face , state );
138-
139- const auto & grad_phi = _var .gradSln (* elem_info );
140-
141- const auto & nhat = _current_face_info -> normal ();
142-
143- const auto d_cf = computeCellToFaceVector (); // vector from boundary cell centre to boundary face
144- const auto projection = d_cf * nhat ;
145- const auto vc = d_cf - (projection * nhat ); // correction vector for non-orthogonal cells
146-
147- return (gamma * projection / (alpha + (beta * projection ))) +
148- (alpha * grad_phi * vc / (alpha + (beta * projection )));
149- }
150-
151- // implicit terms for diffusion kernel
152- Real
153- LinearFVAdvectionDiffusionFunctorRobinBC ::computeBoundaryGradientMatrixContribution () const
154- {
155- const auto face = singleSidedFaceArg (_current_face_info );
156- const auto state = determineState ();
157-
158- const auto alpha = getAlpha (face , state );
159- const auto beta = getBeta (face , state );
160-
161- const auto & nhat = _current_face_info -> normal ();
162-
163- return beta / (alpha + (beta * computeCellToFaceVector () * nhat ));
164- }
165-
166- // explicit terms for diffusion kernel
167- Real
168- LinearFVAdvectionDiffusionFunctorRobinBC ::computeBoundaryGradientRHSContribution () const
169- {
170- mooseAssert (_current_face_type != FaceInfo ::VarFaceNeighbors ::BOTH ,
171- "This should not be assigned on an internal face!" );
172- const auto & elem_info = _current_face_type == FaceInfo ::VarFaceNeighbors ::ELEM
173- ? _current_face_info -> elemInfo ()
174- : _current_face_info -> neighborInfo ();
175- const auto face = singleSidedFaceArg (_current_face_info );
176- const auto state = determineState ();
177- const auto & grad_phi = _var .gradSln (* elem_info );
178-
179- const auto alpha = getAlpha (face , state );
180- const auto beta = getBeta (face , state );
181- const auto gamma = getGamma (face , state );
182-
183- const auto & nhat = _current_face_info -> normal ();
184-
185- const auto d_cf = computeCellToFaceVector (); // vector from boundary cell centre to boundary face
186- const auto projection = d_cf * nhat ;
187- const auto vc = d_cf - (projection * nhat ); // correction vector for non-orthogonal cells
188-
189- return (gamma / alpha ) + (- beta * gamma * projection / alpha / (alpha + (beta * projection ))) +
190- (- beta * grad_phi * vc / (alpha + (beta * projection )));
191- }
0 commit comments