https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FVVelocityJumpGreenGaussGradient.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
10
11#include "LinearSystem.h"
14
16
19{
21 params.suppressParameter<MooseEnum>("limiter");
22 params.addClassDescription("Computes a Green-Gauss velocity gradient using one-sided face states "
23 "on pressure baffles.");
24 return params;
25}
26
31
32void
34{
35 if (_rhie_chow && _rhie_chow != &rc)
36 mooseError("Already linked to PorousRhieChowMassFlux '",
38 "'. Use a separate gradient method for each flow system.");
39
40 _rhie_chow = &rc;
41}
42
45 const ElemInfo & elem_info,
46 const ElemInfo & neighbor_info,
47 const MooseLinearVariableFV<Real> & variable,
48 const Real elem_value,
49 const Real neighbor_value) const
50{
53 fi, elem_info, neighbor_info, variable, elem_value, neighbor_value);
54
55 for (const auto component : make_range(_rhie_chow->dimension()))
56 {
57 const auto & velocity = _rhie_chow->velocityVariable(component);
58 if (velocity.number() != variable.number() ||
59 _rhie_chow->momentumSystem(component).number() != variable.sys().number())
60 continue;
61
62 // The face states are exact for a velocity that is linear on each side, so the gradient
63 // carries no slope from the jump across the baffle.
64 return {_rhie_chow->baffleFaceVelocity(fi, /*elem_side=*/true)(component),
65 _rhie_chow->baffleFaceVelocity(fi, /*elem_side=*/false)(component)};
66 }
67
68 mooseError("Can only compute gradients of the velocity variables of PorousRhieChowMassFlux '",
70 "', but it was used for variable '",
71 variable.name(),
72 "'.");
73}
registerMooseObject("NavierStokesApp", FVVelocityJumpGreenGaussGradient)
static InputParameters validParams()
virtual InternalFaceValues internalFaceValues(const FaceInfo &fi, const ElemInfo &elem_info, const ElemInfo &neighbor_info, const MooseLinearVariableFV< Real > &variable, Real elem_value, Real neighbor_value) const
std::pair< Real, Real > InternalFaceValues
Green-Gauss velocity gradient that uses the one-sided baffle face states of a porous Rhie-Chow object...
const PorousRhieChowMassFlux * _rhie_chow
Porous Rhie-Chow object supplying baffle locations and face states after linkage.
FVVelocityJumpGreenGaussGradient(const InputParameters &params)
void linkFlowSystem(const PorousRhieChowMassFlux &rc)
Link this method to the porous Rhie-Chow object that supplies the baffle face states.
InternalFaceValues internalFaceValues(const FaceInfo &fi, const ElemInfo &elem_info, const ElemInfo &neighbor_info, const MooseLinearVariableFV< Real > &variable, Real elem_value, Real neighbor_value) const override
void suppressParameter(const std::string &name)
void addClassDescription(const std::string &doc_string)
const std::string & name() const
void mooseError(Args &&... args) const
SystemBase & sys()
unsigned int number() const
Computes Rhie-Chow face mass fluxes for porous flow with optional internal pressure jumps.
bool faceIsBaffle(const FaceInfo &fi) const
Whether a face is governed by a pressure-jump model.
RealVectorValue baffleFaceVelocity(const FaceInfo &fi, bool elem_side) const
Return the superficial velocity at a baffle face as seen from one side.
MooseLinearVariableFVReal & velocityVariable(unsigned int component)
Velocity variable for one spatial component.
LinearSystem & momentumSystem(unsigned int component)
Momentum linear system for one spatial component.
unsigned int dimension() const
Number of spatial dimensions of the coupled momentum/pressure systems.
unsigned int number() const