diff --git a/framework/src/problems/FEProblemBase.C b/framework/src/problems/FEProblemBase.C index 6bb47530c5b5..1f061dc31231 100644 --- a/framework/src/problems/FEProblemBase.C +++ b/framework/src/problems/FEProblemBase.C @@ -4087,17 +4087,20 @@ FEProblemBase::addObjectParamsHelper(InputParameters & parameters, const std::string & object_name, const std::string & var_param_name) { - const auto solver_sys_num = + const auto sys_num = parameters.isParamValid(var_param_name) && - determineSolverSystem(parameters.varName(var_param_name, object_name)).first - ? determineSolverSystem(parameters.varName(var_param_name, object_name)).second + &getSystem(parameters.varName(var_param_name, object_name)) + ? getSystem(parameters.varName(var_param_name, object_name)).number() : (unsigned int)0; if (_displaced_problem && parameters.have_parameter("use_displaced_mesh") && parameters.get("use_displaced_mesh")) { parameters.set("_subproblem") = _displaced_problem.get(); - parameters.set("_sys") = &_displaced_problem->solverSys(solver_sys_num); + if (sys_num == _aux->number()) + parameters.set("_sys") = _aux.get(); + else + parameters.set("_sys") = &_displaced_problem->solverSys(sys_num); } else { @@ -4109,7 +4112,11 @@ FEProblemBase::addObjectParamsHelper(InputParameters & parameters, parameters.set("use_displaced_mesh") = false; parameters.set("_subproblem") = this; - parameters.set("_sys") = _solver_systems[solver_sys_num].get(); + + if (sys_num == _aux->number()) + parameters.set("_sys") = _aux.get(); + else + parameters.set("_sys") = _solver_systems[sys_num].get(); } } diff --git a/framework/src/variables/MooseLinearVariableFV.C b/framework/src/variables/MooseLinearVariableFV.C index ce2439d34d22..47543dd536e5 100644 --- a/framework/src/variables/MooseLinearVariableFV.C +++ b/framework/src/variables/MooseLinearVariableFV.C @@ -163,6 +163,7 @@ MooseLinearVariableFV::evaluate(const FaceArg & face, const StateArg mooseAssert(fi, "The face information must be non-null"); const auto face_type = fi->faceType(std::make_pair(this->_var_num, this->_sys_num)); + if (face_type == FaceInfo::VarFaceNeighbors::BOTH) return Moose::FV::interpolate(*this, face, state); else if (auto * bc_pointer = this->getBoundaryCondition(*fi->boundaryIDs().begin())) diff --git a/modules/navier_stokes/src/functormaterials/LinearFVEnthalpyFunctorMaterial.C b/modules/navier_stokes/src/functormaterials/LinearFVEnthalpyFunctorMaterial.C index 5a3564d27dca..63df72df7798 100644 --- a/modules/navier_stokes/src/functormaterials/LinearFVEnthalpyFunctorMaterial.C +++ b/modules/navier_stokes/src/functormaterials/LinearFVEnthalpyFunctorMaterial.C @@ -59,7 +59,8 @@ LinearFVEnthalpyFunctorMaterial::LinearFVEnthalpyFunctorMaterial(const InputPara { addFunctorProperty("h_from_p_T", [this](const auto & r, const auto & t) -> Real - { return _fluid->h_from_p_T(raw_value(_pressure(r, t)), raw_value(_T_fluid(r, t))); }); + { + return _fluid->h_from_p_T(raw_value(_pressure(r, t)), raw_value(_T_fluid(r, t))); }); addFunctorProperty("T_from_p_h", [this](const auto & r, const auto & t) -> Real { return _fluid->T_from_p_h(raw_value(_pressure(r, t)), raw_value(_h(r, t))); }); diff --git a/modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/enthalpy_equation.i b/modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/enthalpy_equation.i index c867fec7865d..5263a4cd9cb2 100644 --- a/modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/enthalpy_equation.i +++ b/modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/enthalpy_equation.i @@ -1,5 +1,5 @@ -H = 0.05 #halfwidth of the channel, 10 cm of channel height -L = 30 +H = 0.015 #halfwidth of the channel, 10 cm of channel height +L = 3 bulk_u = 0.01 p_ref = 101325.0 #inlet_temp = 860. @@ -15,20 +15,11 @@ advected_interp_method = 'upwind' xmax = ${L} ymin = -${H} ymax = ${H} - nx = 200 - ny = 80 - #bias_y = 0.95 + nx = 100 + ny = 30 [] [] -[GlobalParams] - rhie_chow_user_object = 'rc' - advected_interp_method = ${advected_interp_method} - #velocity_interp_method = 'rc' - u = vel_x - v = vel_y -[] - [Problem] linear_sys_names = 'u_system v_system pressure_system energy_system' previous_nl_solution_required = true @@ -64,7 +55,7 @@ advected_interp_method = 'upwind' [h] type = MooseLinearVariableFVReal solver_sys = energy_system - initial_condition = ${fparse 860.*2416.} # 1900 is an approx of cp(T) + initial_condition = 44000 # 1900 is an approx of cp(T) [] [] @@ -83,7 +74,7 @@ advected_interp_method = 'upwind' [] [T] type = MooseLinearVariableFVReal - initial_condition = 860. + initial_condition = 777. [] [] @@ -95,6 +86,10 @@ advected_interp_method = 'upwind' mu = 'mu' momentum_component = 'x' use_nonorthogonal_correction = false + advected_interp_method = ${advected_interp_method} + rhie_chow_user_object = 'rc' + u = vel_x + v = vel_y [] [u_pressure] type = LinearFVMomentumPressure @@ -109,6 +104,10 @@ advected_interp_method = 'upwind' mu = 'mu' momentum_component = 'y' use_nonorthogonal_correction = false + advected_interp_method = ${advected_interp_method} + rhie_chow_user_object = 'rc' + u = vel_x + v = vel_y [] [v_pressure] type = LinearFVMomentumPressure @@ -138,6 +137,8 @@ advected_interp_method = 'upwind' [temp_advection] type = LinearFVEnergyAdvection variable = h + advected_interp_method = ${advected_interp_method} + rhie_chow_user_object = 'rc' [] [] @@ -232,7 +233,8 @@ advected_interp_method = 'upwind' [FluidProperties] [salt] - type = FlibeFluidProperties + # type = FlibeFluidProperties + type = LeadFluidProperties [] [] @@ -250,7 +252,7 @@ advected_interp_method = 'upwind' type = ADParsedFunctorMaterial property_name = 'alpha' functor_names = 'k cp' - expression = '100*k/cp' + expression = 'k/cp' [] [enthalpy_material] type = LinearFVEnthalpyFunctorMaterial @@ -308,8 +310,8 @@ advected_interp_method = 'upwind' energy_system = 'energy_system' momentum_equation_relaxation = 0.7 pressure_variable_relaxation = 0.3 - energy_equation_relaxation = 0.7 - num_iterations = 1000 + energy_equation_relaxation = 0.9 + num_iterations = 200 pressure_absolute_tolerance = 1e-8 momentum_absolute_tolerance = 1e-8 energy_absolute_tolerance = 1e-8