Line data Source code
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 : 10 : #include "NavierStokesPhysicsBase.h" 11 : #include "INSFVRhieChowInterpolator.h" 12 : #include "NSFVUtils.h" 13 : #include "RelationshipManager.h" 14 : #include "WCNSFVFlowPhysics.h" 15 : 16 : InputParameters 17 3253 : NavierStokesPhysicsBase::validParams() 18 : { 19 3253 : InputParameters params = PhysicsBase::validParams(); 20 3253 : params.addClassDescription( 21 : "Base class to define the Navier Stokes incompressible and weakly-compressible equation"); 22 : 23 6506 : params.addParam<bool>( 24 : "define_variables", 25 6506 : true, 26 : "Whether to define variables if the variables with the specified names do not exist. Note " 27 : "that if the variables are defined externally from the Physics, the initial conditions will " 28 : "not be created in the Physics either."); 29 : 30 6506 : params.addParam<unsigned short>( 31 6506 : "ghost_layers", 2, "Number of layers of elements to ghost near process domain boundaries"); 32 6506 : params.addParamNamesToGroup("define_variables ghost_layers", "Advanced"); 33 : 34 3253 : return params; 35 0 : } 36 : 37 3253 : NavierStokesPhysicsBase::NavierStokesPhysicsBase(const InputParameters & parameters) 38 6506 : : PhysicsBase(parameters), _define_variables(getParam<bool>("define_variables")) 39 : { 40 3253 : } 41 : 42 : void 43 284 : NavierStokesPhysicsBase::addFVAdvectedInterpolationMethod(const MooseEnum & interpolation_method) 44 : { 45 : const std::string method_name = interpolation_method; 46 852 : if (getProblem().hasFVInterpolationMethod(method_name)) 47 : return; 48 : 49 183 : const auto method_type = NS::fvAdvectedInterpolationMethodType(interpolation_method); 50 : 51 183 : InputParameters params = getFactory().getValidParams(method_type); 52 183 : getProblem().addFVInterpolationMethod(method_type, method_name, params); 53 183 : } 54 : 55 : InputParameters 56 9225 : NavierStokesPhysicsBase::getAdditionalRMParams() const 57 : { 58 18450 : unsigned short necessary_layers = getParam<unsigned short>("ghost_layers"); 59 9225 : necessary_layers = std::max(necessary_layers, getNumberAlgebraicGhostingLayersNeeded()); 60 : 61 : // Just an object that has a ghost_layers parameter 62 9225 : const std::string kernel_type = "INSFVMixingLengthReynoldsStress"; 63 9225 : InputParameters params = getFactory().getValidParams(kernel_type); 64 9225 : params.template set<unsigned short>("ghost_layers") = necessary_layers; 65 : 66 9225 : return params; 67 0 : }