https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousRhieChowMassFlux.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11
12#include "MathFVUtils.h"
13#include "MooseMesh.h"
14#include "NS.h"
19#include "LinearSystem.h"
25#include "PressureJumpModel.h"
26
27using namespace libMesh;
28
30
33{
36 "Rhie-Chow mass flux object specialized for porous flow/baffle cases.");
37
38 params.addParam<MooseFunctorName>(
39 NS::porosity, "1", "Porosity functor (defaults to 1 for non-porous calculations).");
40 params.addParam<std::vector<UserObjectName>>(
41 "pressure_jump_models", {}, "Pressure jump models applied by this object.");
42 params.addRangeCheckedParam<Real>("pressure_jump_relaxation",
43 1.0,
44 "0.0<pressure_jump_relaxation<=1.0",
45 "Under-relaxation factor for pressure jump updates.");
46 return params;
47}
48
50 : RhieChowMassFlux(params),
51 _eps(getFunctor<Real>(NS::porosity)),
52 _pressure_jump_relaxation(getParam<Real>("pressure_jump_relaxation")),
53 _baffle_jump(
54 declareRestartableData<FaceCenteredMapFunctor<Real, std::unordered_map<dof_id_type, Real>>>(
55 "baffle_jump", _moose_mesh, blockIDs(), "baffle_jump"))
56{
57 // A face on this object's blocks must be either fully internal or fully external to the
58 // pressure and velocity variables too; a face that is one-sided for a momentum variable but
59 // two-sided for this object has no baffle treatment.
60 if (_p->blockIDs() != blockIDs())
62 "Pressure variable '",
63 _p->name(),
64 "' must have the same block restriction as this object. Variable blocks: ",
66 "; this object's blocks: ",
68 ".");
69 for (const auto * const velocity : _vel)
70 if (velocity->blockIDs() != blockIDs())
71 paramError("u",
72 "Velocity variable '",
73 velocity->name(),
74 "' must have the same block restriction as this object. Variable blocks: ",
75 Moose::stringify(velocity->blockIDs()),
76 "; this object's blocks: ",
78 ".");
79
80 std::unordered_set<BoundaryID> pressure_jump_boundary_ids;
81 for (const auto & model_name : getParam<std::vector<UserObjectName>>("pressure_jump_models"))
82 {
83 const auto & model = getUserObjectByName<PressureJumpModel>(model_name);
84 for (const auto boundary_id : model.boundaryIDs())
85 if (!pressure_jump_boundary_ids.insert(boundary_id).second)
86 paramError("pressure_jump_models",
87 "Pressure jump models must not act on overlapping boundaries.");
88 _pressure_jump_models.push_back(&model);
89
90 // A jump model evaluating different porosity or density than this object would act on a
91 // flow that is not the one being solved.
92 for (const auto & [model_param, rc_param] :
93 {std::make_pair("porosity", NS::porosity), std::make_pair("density", NS::density)})
94 if (model.parameters().have_parameter<MooseFunctorName>(model_param) &&
95 model.getParam<MooseFunctorName>(model_param) != getParam<MooseFunctorName>(rc_param))
96 paramError("pressure_jump_models",
97 "Pressure jump model '",
98 model.name(),
99 "' uses ",
100 model_param,
101 " '",
102 model.getParam<MooseFunctorName>(model_param),
103 "' but this object uses '",
104 getParam<MooseFunctorName>(rc_param),
105 "'.");
106 }
107}
108
109void
111 const std::vector<LinearSystem *> & momentum_systems,
112 LinearSystem & pressure_system,
113 const std::vector<unsigned int> & momentum_system_numbers)
114{
116 momentum_systems, pressure_system, momentum_system_numbers);
117
118 // A pressure jump represents a baffle interior to the flow domain. A boundary with no
119 // flow-block element on one side is a domain boundary, not a baffle. The boundary element
120 // range this check needs is not yet built when this object is constructed.
121 for (const auto * const model : _pressure_jump_models)
122 for (const auto boundary_id : model->boundaryIDs())
124 paramError("pressure_jump_models",
125 "Pressure jump model '",
126 model->name(),
127 "' boundary '",
128 _moose_mesh.getBoundaryName(boundary_id),
129 "' is not internal to this object's blocks. Pressure-jump baffles must lie "
130 "strictly inside the flow domain.");
131
132 // The porous momentum pressure kernels must weight the pressure gradient with the porosity
133 // this object uses to form the face fluxes.
134 for (const auto system_number : momentum_system_numbers)
135 {
136 std::vector<LinearFVElementalKernel *> kernels;
138 .query()
139 .template condition<AttribThread>(_tid)
140 .template condition<AttribSystem>("LinearFVElementalKernel")
141 .template condition<AttribSysNum>(system_number)
142 .queryInto(kernels);
143
144 for (const auto * const kernel : kernels)
145 if (const auto * const pressure_kernel =
146 dynamic_cast<const LinearPWCNSFVMomentumPressure *>(kernel);
147 pressure_kernel && MooseUtils::setsIntersect(pressure_kernel->blockIDs(), blockIDs()) &&
148 pressure_kernel->getParam<MooseFunctorName>(NS::porosity) !=
149 getParam<MooseFunctorName>(NS::porosity))
151 "Momentum pressure kernel '",
152 pressure_kernel->name(),
153 "' uses porosity '",
154 pressure_kernel->getParam<MooseFunctorName>(NS::porosity),
155 "' but this object uses '",
156 getParam<MooseFunctorName>(NS::porosity),
157 "'.");
158 }
159
160 if (hasPressureBaffles() &&
162 paramError("p_diffusion_kernel",
163 "Pressure jump models require LinearFVPressureCorrectionDiffusionJump.");
164
165 auto * const pressure_var =
167 mooseAssert(pressure_var, "The pressure variable type was checked by RhieChowMassFlux.");
168 const auto & solution_gradient_reader = pressure_var->requestCellGradients();
169
170 if (hasPressureBaffles())
171 {
172 auto * const jump_gradient_method = dynamic_cast<FVPressureJumpGreenGaussGradient *>(
173 &_fe_problem.getFVGradientMethod(solution_gradient_reader.method().name(), _tid));
174 if (!jump_gradient_method)
175 mooseError("Pressure variable '",
176 pressure_var->name(),
177 "' must use FVPressureJumpGreenGaussGradient as its default gradient method "
178 "when this object has pressure baffles.");
179
180 jump_gradient_method->linkFlowSystem(*this, solution_gradient_reader);
181
183 {
184 if (&basePressureGradientField().method() != &solution_gradient_reader.method())
185 mooseError("FVReconstructedPressureGradient '",
187 "' must use the pressure variable's FVPressureJumpGreenGaussGradient as its "
188 "base_gradient_method when this object has pressure baffles.");
189 }
190 else if (&pressureGradientField().method() != &solution_gradient_reader.method())
192 "Momentum pressure kernels coupled to this object must use the pressure "
193 "variable's FVPressureJumpGreenGaussGradient or an FVReconstructedPressureGradient "
194 "based on it when pressure baffles are present.");
195
196 // Velocity gradients that interpolate across a baffle turn the physical velocity jump into
197 // a slope. Every consumer of the default velocity gradient must see the one-sided states.
198 _velocity_gradients.clear();
199 for (auto * const velocity : _vel)
200 {
201 const auto & velocity_gradient = velocity->requestCellGradients();
202 auto * const velocity_gradient_method = dynamic_cast<FVVelocityJumpGreenGaussGradient *>(
203 &_fe_problem.getFVGradientMethod(velocity_gradient.method().name(), _tid));
204 if (!velocity_gradient_method)
205 mooseError("Velocity variable '",
206 velocity->name(),
207 "' must use FVVelocityJumpGreenGaussGradient as its default gradient method "
208 "when this object has pressure baffles.");
209
210 velocity_gradient_method->linkFlowSystem(*this);
211 _velocity_gradients.push_back(&velocity_gradient);
212 }
213 }
214
216}
217
218void
220{
221 // This runs before every pressure corrector, so PIMPLE relaxes the jump once per PISO corrector
222 // and the effective relaxation per outer iteration grows with num_piso_iterations. Without a
223 // reconstructed pressure gradient, all those updates use the same face flux.
225
226 // Pressure jumps are external data for the variable's gradient method. Refresh that field
227 // before pressure assembly even though the pressure solution itself has not changed yet.
228 if (hasPressureBaffles())
230
232
233 // Each side of a baffle carries its own momentum relation rho_s U_s.n = -h_s + (pressure flux),
234 // with h_s = rho_s (H/A)_s.n. Continuity of the mass flux weights the side H/A fluxes with the
235 // same half-cell conductances as the pressure, so a body force balanced by the pressure on each
236 // side (a fluid at rest across a porosity or density jump) gives zero face flux. The face area
237 // is 1 to match computeFacePressureGradientFlux, and the pressure gradients only enter the
238 // nonorthogonal correction, which the H/A flux does not use.
239 if (hasPressureBaffles())
240 for (const auto * const fi : _flow_face_info)
241 if (_vel[0]->isInternalFace(*fi) && faceIsBaffle(*fi))
244}
245
246void
253
254void
256{
257 const auto time_arg = Moose::currentState();
258 for (const auto & elem_info : _fe_problem.mesh().elemInfoVector())
259 if (hasBlocks(elem_info->subdomain_id()))
260 {
261 const auto elem_dof = elem_info->dofIndices()[_global_pressure_system_number][0];
262 const Real cell_volume = elem_info->volume() * elem_info->coordFactor();
263 _cell_fluid_volumes->set(elem_dof,
264 cell_volume * _eps(makeElemArg(elem_info->elem()), time_arg));
265 }
266
267 _cell_fluid_volumes->close();
268}
269
270void
278
279Real
281 bool elem_side,
282 const Moose::StateArg & time) const
283{
284 const Elem * const elem = elem_side ? fi.elemPtr() : fi.neighborPtr();
285 if (!elem)
286 return 1.0;
287
288 return _eps(makeElemArg(elem), time);
289}
290
291Real
293{
294 const auto * const pressure_jump_model = getPressureJumpModel(fi);
295 if (!pressure_jump_model)
296 return 0.0;
297
298 const Real J = _baffle_jump.evaluate(&fi);
299 const bool elem_is_owner = pressure_jump_model->elemIsOwner(fi);
300 // J is stored as (p_non_owner - p_owner), so the owner side sees -J.
301 return (elem_side == elem_is_owner) ? -J : J;
302}
303
304void
306{
307 if (_pressure_jump_models.empty())
308 return;
309
310 for (auto & fi : _flow_face_info)
311 {
312 const auto * const pressure_jump_model = getPressureJumpModel(*fi);
313 if (!pressure_jump_model || !fi->neighborPtr())
314 continue;
315 if (!hasBlocks(fi->elemPtr()->subdomain_id()) || !hasBlocks(fi->neighborPtr()->subdomain_id()))
316 continue;
317
318 const Real new_jump =
319 pressure_jump_model->computePressureJump(*fi, _face_mass_flux.evaluate(fi));
320 _baffle_jump[fi->id()] = _pressure_jump_relaxation * new_jump +
321 (1.0 - _pressure_jump_relaxation) * _baffle_jump[fi->id()];
322 }
323}
324
325bool
327{
328 return getPressureJumpModel(fi) != nullptr;
329}
330
332PorousRhieChowMassFlux::baffleFaceVelocity(const FaceInfo & fi, const bool elem_side) const
333{
334 mooseAssert(fi.neighborPtr() && faceIsBaffle(fi), "Baffle face states require a baffle face.");
335
336 const auto & cell_info = elem_side ? *fi.elemInfo() : *fi.neighborInfo();
337 const auto state = Moose::currentState();
338 RealVectorValue velocity;
339 for (const auto component : index_range(_vel))
340 velocity(component) = _vel[component]->getElemValue(cell_info, state);
341
342 // Gradient history is initialized before the velocity gradients are linked.
343 if (_velocity_gradients.empty())
344 return velocity;
345
346 const auto cell_to_face = fi.faceCentroid() - cell_info.centroid();
347 for (const auto component : index_range(_vel))
348 velocity(component) += _velocity_gradients[component]->gradient(cell_info) * cell_to_face;
349
350 return velocity;
351}
352
353Real
355{
356 mooseAssert(fi.neighborPtr() && faceIsBaffle(fi), "Baffle face states require a baffle face.");
357
358 const auto state = Moose::currentState();
359 const Real elem_rho = _rho(makeElemArg(fi.elemPtr()), state);
360 const Real neighbor_rho = _rho(makeElemArg(fi.neighborPtr()), state);
361 if (elem_rho <= 0.0 || neighbor_rho <= 0.0)
362 mooseError("density must be positive on pressure-jump face ", fi.id(), ".");
363
364 // Mass conservation makes rho U.n continuous. Density is assumed to vary smoothly across the
365 // baffle, as in BernoulliFormLossPressureJump, so the same face-interpolated density recovers
366 // one normal velocity for both sides. Dividing by the cell-center density instead would make
367 // the normal velocity first-order accurate wherever density varies within the cell.
368 Real face_rho = 0.0;
370 Moose::FV::InterpMethod::Average, face_rho, elem_rho, neighbor_rho, fi, true);
371 return _face_mass_flux.evaluate(&fi) / face_rho;
372}
373
374Real
376 const unsigned int component) const
377{
378 mooseAssert(component < _Ainv_raw.size(), "Invalid pressure-diffusion component.");
379
380 const auto momentum_dof = elem_info.dofIndices()[_global_momentum_system_numbers[component]][0];
381 const Real density = _rho(makeElemArg(elem_info.elem()), Moose::currentState());
382 return density * (*_Ainv_raw[component])(momentum_dof);
383}
384
385bool
390
391bool
393{
394 mooseAssert(pressureDiffusionDataReady(), "Pressure-diffusion data must be ready first.");
396}
397
400 const RealVectorValue & elem_gradient,
401 const RealVectorValue & neighbor_gradient,
402 const Real face_area) const
403{
405 if (!fi.neighborPtr() || !faceIsBaffle(fi))
406 return data;
407
408 mooseAssert(pressureDiffusionDataReady(),
409 "Pressure-diffusion data must be ready before constructing a baffle face operator.");
410
411 const auto & elem_info = *fi.elemInfo();
412 const auto & neighbor_info = *fi.neighborInfo();
413 const auto time_arg = Moose::currentState();
414 const Real elem_rho = _rho(makeElemArg(fi.elemPtr()), time_arg);
415 const Real neighbor_rho = _rho(makeElemArg(fi.neighborPtr()), time_arg);
416 RealVectorValue elem_diffusion;
417 RealVectorValue neighbor_diffusion;
418 RealVectorValue elem_rho_hbya;
419 RealVectorValue neighbor_rho_hbya;
420 for (const auto component : make_range(dimension()))
421 {
422 elem_diffusion(component) = cellPressureDiffusionCoefficient(elem_info, component);
423 neighbor_diffusion(component) = cellPressureDiffusionCoefficient(neighbor_info, component);
424 const auto system_number = _global_momentum_system_numbers[component];
425 elem_rho_hbya(component) =
426 elem_rho * (*_HbyA_raw[component])(elem_info.dofIndices()[system_number][0]);
427 neighbor_rho_hbya(component) =
428 neighbor_rho * (*_HbyA_raw[component])(neighbor_info.dofIndices()[system_number][0]);
429 }
430
432 fi.faceCentroid() - elem_info.centroid(),
433 neighbor_info.centroid() - fi.faceCentroid(),
434 elem_diffusion,
435 neighbor_diffusion,
436 elem_gradient,
437 neighbor_gradient,
438 elem_rho_hbya,
439 neighbor_rho_hbya,
440 face_area,
442 getSignedBaffleJump(fi, /*elem_side=*/true));
443
444 // A valid mesh gives positive projected half-cell distances, and a positive momentum diagonal
445 // and density give positive conductances.
446 mooseAssert(data.valid,
447 "Cannot construct the pressure-jump operator on face " + std::to_string(fi.id()) +
448 ": the half-cell distances, normal pressure diffusion coefficients, face area, "
449 "and conductances must be finite and positive, and the corrections finite.");
450
451 return data;
452}
453
454const PressureJumpModel *
456{
457 const PressureJumpModel * face_model = nullptr;
458 for (const auto * const model : _pressure_jump_models)
459 if (model->appliesTo(fi))
460 {
461 // The models act on disjoint boundaries, but a face can still carry boundaries of two
462 // models, which would make its jump ambiguous.
463 mooseAssert(!face_model,
464 "Pressure-jump face " + std::to_string(fi.id()) +
465 " lies on boundaries of more than one pressure jump model.");
466 face_model = model;
467 }
468
469 return face_model;
470}
const PertinentGeochemicalSystem model(database, {"H2O", "H+", "HCO3-", "O2(aq)", "Ca++", ">(s)FeOH", "radius_neg1", "radius_neg1.5"}, {"Calcite"}, {}, {"Calcite_asdf"}, {"CH4(aq)"}, {">(s)FeOCa+"}, "O2(aq)", "e-")
registerMooseObject("NavierStokesApp", PorousRhieChowMassFlux)
bool hasBlocks(const SubdomainName &name) const
virtual const std::set< SubdomainID > & blockIDs() const
const Elem * elem() const
const std::vector< std::vector< dof_id_type > > & dofIndices() const
FVGradientMethod & getFVGradientMethod(const GradientMethodName &name, const THREAD_ID tid=0)
virtual MooseMesh & mesh() override
TheWarehouse & theWarehouse() const
Green-Gauss pressure gradient that removes prescribed jumps before interpolating across baffles.
Green-Gauss velocity gradient that uses the one-sided baffle face states of a porous Rhie-Chow object...
A functor whose evaluation relies on querying a map where the keys are face info ids and the values c...
ValueType evaluate(const FaceInfo *const fi) const
Evaluate the face functor using a FaceInfo argument.
const Point & normal() const
const Elem * neighborPtr() const
const ElemInfo * elemInfo() const
const ElemInfo * neighborInfo() const
dof_id_type id() const
const Elem * elemPtr() const
const Point & faceCentroid() const
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
bool useNonorthogonalCorrection() const
const FVGradientMethod & method() const
Pressure-correction diffusion kernel that enforces modeled jumps on internal baffle faces.
Adds the porosity-weighted pressure gradient to the right hand side of the momentum equation written ...
void updateFVGradient(const LinearFVGradientReader &reader)
const std::string & name() const
void paramError(const std::string &param, Args... args) const
void mooseError(Args &&... args) const
const T & getParam(const std::string &name) const
const std::string & getBoundaryName(const BoundaryID boundary_id) const
const std::vector< const FaceInfo * > & faceInfo() const
const std::vector< const ElemInfo * > & elemInfoVector() const
bool isBoundaryFullyExternalToSubdomains(BoundaryID bid, const std::set< SubdomainID > &blk_group) const
unsigned int number() const
Computes Rhie-Chow face mass fluxes for porous flow with optional internal pressure jumps.
const Moose::Functor< Real > & _eps
Porosity functor.
bool pressureDiffusionDataReady() const
Whether the pressure-diffusion kernel and cell coefficients are ready for interface use.
const Real _pressure_jump_relaxation
Under-relaxation factor applied when updating pressure jumps.
bool pressureDiffusionUsesNonorthogonalCorrection() const
Whether the linked pressure-diffusion kernel applies a nonorthogonal correction.
void linkMomentumPressureSystems(const std::vector< LinearSystem * > &momentum_systems, LinearSystem &pressure_system, const std::vector< unsigned int > &momentum_system_numbers) override
Update the momentum system-related information.
bool hasPressureBaffles() const
Whether at least one pressure-jump model is configured.
bool faceIsBaffle(const FaceInfo &fi) const
Whether a face is governed by a pressure-jump model.
void setupPorousMeshInformation()
Overwrite the cached cell fluid volumes with cell volume times porosity.
const PressureJumpModel * getPressureJumpModel(const FaceInfo &fi) const
Return the pressure-jump model that applies to the face, or null if there is none.
Real baffleNormalVelocity(const FaceInfo &fi) const
Return the normal superficial velocity at a baffle face, recovered from the shared face mass flux and...
Real getFaceSidePorosity(const FaceInfo &fi, bool elem_side, const Moose::StateArg &time) const
Return the porosity on one side of a face.
std::vector< const PressureJumpModel * > _pressure_jump_models
Pressure-jump models with mutually disjoint boundary sets.
PorousRhieChowMassFlux(const InputParameters &params)
Construct the porous Rhie-Chow mass flux object.
static InputParameters validParams()
std::vector< const LinearFVGradientReader * > _velocity_gradients
Published velocity gradients, one per component, read by the baffle face states.
void updateBaffleJumps()
Recompute and relax the pressure jumps using the current face mass fluxes.
void meshChanged() override
Clear face-indexed baffle-jump data after a mesh change.
void computeHbyA(bool verbose) override
Computes the inverse of the diagonal (1/A) of the system matrix plus the H/A components for the press...
FaceCenteredMapFunctor< Real, std::unordered_map< dof_id_type, Real > > & _baffle_jump
Restartable face field storing pressure as non-owner minus owner.
NS::FV::PressureJumpInterfaceData pressureJumpInterfaceData(const FaceInfo &fi, const RealVectorValue &elem_gradient, const RealVectorValue &neighbor_gradient, Real face_area) const
Construct the complete pressure-jump operator for a face.
void initCouplingField() override
Populate baffle-jump storage after initializing the pressure coupling field.
RealVectorValue baffleFaceVelocity(const FaceInfo &fi, bool elem_side) const
Return the superficial velocity at a baffle face as seen from one side.
Real getSignedBaffleJump(const FaceInfo &fi, bool elem_side) const
Return the pressure jump seen from one side of a baffle face.
Real cellPressureDiffusionCoefficient(const ElemInfo &elem_info, unsigned int component) const
Cell coefficient whose face interpolation forms the pressure-diffusion tensor.
Interface for pressure-jump models evaluated by PorousRhieChowMassFlux.
User object responsible for determining the face fluxes using the Rhie-Chow interpolation in a segreg...
const MooseMesh & _moose_mesh
The MooseMesh that this user object operates on.
const LinearFVGradientReader & basePressureGradientField() const
Get the base pressure gradient field used to seed reconstructed gradient updates.
virtual void computeHbyA(bool verbose)
Computes the inverse of the diagonal (1/A) of the system matrix plus the H/A components for the press...
virtual void linkMomentumPressureSystems(const std::vector< LinearSystem * > &momentum_systems, LinearSystem &pressure_system, const std::vector< unsigned int > &momentum_system_numbers)
Update the momentum system-related information.
LinearFVPressureCorrectionDiffusion * _p_diffusion_kernel
Pointer to the pressure diffusion term in the pressure Poisson equation.
unsigned int _global_pressure_system_number
Global number of the pressure system.
const MooseLinearVariableFVReal *const _p
The thread 0 copy of the pressure variable.
virtual void meshChanged() override
std::vector< MooseLinearVariableFVReal * > _vel
Thread 0 copies of the velocity variables; non-const to allow writing cell velocities in updateCellVe...
LinearSystem * _pressure_system
Pointer to the pressure system.
std::vector< std::unique_ptr< NumericVector< Number > > > _Ainv_raw
We hold on to the cell-based 1/A vectors so that we can easily reconstruct the cell velocities as wel...
std::vector< const FaceInfo * > _flow_face_info
The subset of the FaceInfo objects that actually cover the subdomains which the flow field is defined...
std::vector< std::unique_ptr< NumericVector< Number > > > _HbyA_raw
We hold on to the cell-based HbyA vectors so that we can easily reconstruct the cell velocities as we...
FVReconstructedPressureGradient & reconstructedGradientMethod()
Access the reconstructed gradient method when it is selected.
const Moose::Functor< Real > & _rho
Functor describing the density of the fluid.
virtual void initCouplingField()
Initialize the coupling fields (HbyA and Ainv)
bool usingReconstructedPressureGradientMethod() const
Whether the registered pressure gradient field is produced by the reconstructed method.
FaceCenteredMapFunctor< Real, std::unordered_map< dof_id_type, Real > > & _face_mass_flux
A map functor from faces to mass fluxes which are used in the advection terms.
const LinearFVGradientReader & pressureGradientField() const
Get the registered pressure gradient field used by compatible momentum pressure kernels.
static InputParameters validParams()
FaceCenteredMapFunctor< Real, std::unordered_map< dof_id_type, Real > > _HbyA_flux
A map functor from faces to $HbyA_{ij} = (A_{offdiag}*\mathrm{(predicted~velocity)} - \mathrm{Source}...
std::unique_ptr< NumericVector< Number > > _cell_fluid_volumes
Fluid volume of each cell, used to rapidly scale the pressure-gradient force in H/A and 1/A.
unsigned int dimension() const
Number of spatial dimensions of the coupled momentum/pressure systems.
std::vector< unsigned int > _global_momentum_system_numbers
Global numbers of the momentum system(s)
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const
Query query()
FEProblemBase & _fe_problem
const THREAD_ID _tid
void interpolate(InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)
std::string stringify(const T &t)
StateArg currentState()
PressureJumpInterfaceData pressureJumpInterfaceData(const RealVectorValue &normal, const Point &elem_to_face, const Point &face_to_neighbor, const RealVectorValue &elem_diffusion, const RealVectorValue &neighbor_diffusion, const RealVectorValue &elem_gradient, const RealVectorValue &neighbor_gradient, const RealVectorValue &elem_rho_hbya, const RealVectorValue &neighbor_rho_hbya, const Real face_area, const bool use_nonorthogonal_correction, const Real elem_jump)
Construct the conservative half-cell interface coefficients for a diagonal diffusion tensor.
Real pressureJumpHbyAFlux(const PressureJumpInterfaceData &data)
Compute the H/A part of the face mass flux after eliminating the interface pressures.
static const std::string density
Definition NS.h:34
static const std::string porosity
Definition NS.h:108
static const std::string pressure
Definition NS.h:57
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
auto index_range(const T &sizable)
VectorValue< Real > RealVectorValue
uint8_t dof_id_type
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
Complete face operator obtained by eliminating the two one-sided interface pressures.