Skip to content

Commit

Permalink
Add support for not setting energy wall BCs on every momentum wall bo…
Browse files Browse the repository at this point in the history
…undary

refs idaholab#29955
  • Loading branch information
GiudGiud committed Feb 25, 2025
1 parent 3ad64d7 commit 86ad48c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
12 changes: 9 additions & 3 deletions modules/navier_stokes/src/base/NSFVBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ NSFVBase::commonFluidEnergyEquationParams()
std::vector<MooseFunctorName>(),
"Functions for fixed-value boundaries in the energy equation.");

params.addParam<std::vector<BoundaryName>>(
"energy_wall_boundaries",
{},
"Wall boundaries to apply energy boundary conditions on. If not specified, the flow equation "
"Physics wall boundaries will be used");

MultiMooseEnum en_wall_types("fixed-temperature heatflux wallfunction");
params.addParam<MultiMooseEnum>(
"energy_wall_types", en_wall_types, "Types for the wall boundaries for the energy equation.");
Expand Down Expand Up @@ -590,9 +596,9 @@ NSFVBase::validParams()

params.addParamNamesToGroup(
"inlet_boundaries momentum_inlet_types momentum_inlet_function energy_inlet_types "
"energy_inlet_function wall_boundaries momentum_wall_types energy_wall_types "
"energy_wall_function outlet_boundaries momentum_outlet_types pressure_function "
"passive_scalar_inlet_types passive_scalar_inlet_function flux_inlet_pps "
"energy_inlet_function wall_boundaries momentum_wall_types energy_wall_boundaries "
"energy_wall_types energy_wall_function outlet_boundaries momentum_outlet_types "
"pressure_function passive_scalar_inlet_types passive_scalar_inlet_function flux_inlet_pps "
"flux_inlet_directions",
"Boundary condition");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ WCNSFVFluidHeatTransferPhysics::addEnergyInletBC()
void
WCNSFVFluidHeatTransferPhysics::addEnergyWallBC()
{
const auto & wall_boundaries = _flow_equations_physics->getWallBoundaries();
const auto & wall_boundaries = isParamSetByUser("energy_wall_boundaries")
? getParam<std::vector<BoundaryName>>("energy_wall_boundaries")
: _flow_equations_physics->getWallBoundaries();
if (wall_boundaries.size() != _energy_wall_types.size())
paramError("energy_wall_types",
"Energy wall types (size " + std::to_string(_energy_wall_types.size()) +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ WCNSFVFluidHeatTransferPhysicsBase::WCNSFVFluidHeatTransferPhysicsBase(
if (isParamValid("energy_inlet_types"))
checkVectorParamAndMultiMooseEnumLength<MooseFunctorName>("energy_inlet_functors",
"energy_inlet_types");
if (isParamSetByUser("energy_wall_boundaries"))
checkVectorParamsSameLengthIfSet<BoundaryName, MooseFunctorName>(
"energy_wall_boundaries", "energy_wall_functors", false);
if (isParamValid("energy_wall_types"))
checkVectorParamAndMultiMooseEnumLength<MooseFunctorName>("energy_wall_functors",
"energy_wall_types");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ WCNSLinearFVFluidHeatTransferPhysics::addEnergyInletBC()
void
WCNSLinearFVFluidHeatTransferPhysics::addEnergyWallBC()
{
const auto & wall_boundaries = _flow_equations_physics->getWallBoundaries();
const auto & wall_boundaries = isParamSetByUser("energy_wall_boundaries")
? getParam<std::vector<BoundaryName>>("energy_wall_boundaries")
: _flow_equations_physics->getWallBoundaries();
if (wall_boundaries.size() != _energy_wall_types.size())
paramError("energy_wall_types",
"Energy wall types (size " + std::to_string(_energy_wall_types.size()) +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,17 @@
detail = "with the fluid flow problem as the main application using a Physics shorthand syntax, "
cli_args = "Executioner/fixed_point_max_its=10 Executioner/fixed_point_rel_tol=1e-12 MultiApps/inactive='' Transfers/inactive=''"
[]
[simple-main-physics-BCs-energy]
type = 'Exodiff'
input = fluid-physics.i
exodiff = 'fluid-physics_out.e fluid-physics_out_solid0.e'
recover = false # we don't support recovery for SIMPLE yet
max_threads = 1 # see libmesh issue #3808
detail = "with the fluid flow problem as the main application using a Physics shorthand syntax, "
cli_args = "Physics/NavierStokes/FluidHeatTransferSegregated/energy/energy_wall_boundaries='top bottom' "
"Executioner/fixed_point_max_its=10 Executioner/fixed_point_rel_tol=1e-12 "
"MultiApps/inactive='' Transfers/inactive=''"
prereq = 'multiapp/simple-main-physics'
[]
[]
[]

0 comments on commit 86ad48c

Please sign in to comment.