- fpThe name of the user object for fluid properties
C++ Type:UserObjectName
Controllable:No
Description:The name of the user object for fluid properties
- reference_pressuresystem reference pressure [Pa]. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:system reference pressure [Pa]. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- variableThe name of the variable that this residual object operates on
C++ Type:NonlinearVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable that this residual object operates on
IncompressibleMomentumSPScalarKernel
Overview
This class derives from IncompressibleMomentumSPBase and implements the steady-state residual of the momentum equation for the Path-integrated incompressible flow model, the right-hand side of Path-Integrated Incompressible Flow Model, Eq. (4). It requires a coupled variable characteristic pressure drop and coupled fluid temperature variables for each segment, given as coupled ScalarVariables. It operates on the mass flow rate, :
Note, use of this kernel with transient problems also necessitates the use of a ODETimeDerivative, which includes the time derivative term, , with being the mass flow rate, which adds the time derivative of the mass flow rate to the residual.
As a reminder, the system of variables should be defined with the "family" attribute set to SCALAR for each variable.
Input Parameters
- alphasComponent flow angles per segment with respect to horizontal (-pi/2 downward to pi/2 upward). Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:std::vector<MooseFunctorName>
Unit:(no unit assumed)
Controllable:No
Description:Component flow angles per segment with respect to horizontal (-pi/2 downward to pi/2 upward). Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- areasComponent flow areas per segment. Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:std::vector<MooseFunctorName>
Unit:(no unit assumed)
Controllable:No
Description:Component flow areas per segment. Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- forms_lossesForms loss coefficients per segment. Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:std::vector<MooseFunctorName>
Unit:(no unit assumed)
Controllable:No
Description:Forms loss coefficients per segment. Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- g9.80665Gravitational acceleration [m/s]. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
Default:9.80665
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:Gravitational acceleration [m/s]. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- is_implicitFalseWhether an explicit (previous value calculation) or implicit (current value) is used
Default:False
C++ Type:bool
Controllable:No
Description:Whether an explicit (previous value calculation) or implicit (current value) is used
- lengthsComponent flow lengths per segment. Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:std::vector<MooseFunctorName>
Unit:(no unit assumed)
Controllable:No
Description:Component flow lengths per segment. Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- perimetersComponent flow perimeters per segment. Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:std::vector<MooseFunctorName>
Unit:(no unit assumed)
Controllable:No
Description:Component flow perimeters per segment. Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- pump_pressuresPump pressure gains per segment [Pa]. Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:std::vector<MooseFunctorName>
Unit:(no unit assumed)
Controllable:No
Description:Pump pressure gains per segment [Pa]. Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- reference_pressure_dropReference system pressure drop from inlet to outlet. Takes a scalar variable name
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:Reference system pressure drop from inlet to outlet. Takes a scalar variable name
- roughnessesComponent wall roughnesses per segment [m]. Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:std::vector<MooseFunctorName>
Unit:(no unit assumed)
Controllable:No
Description:Component wall roughnesses per segment [m]. Takes a vector of functors. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- temperaturesFluid temperature in each segment of this component. Takes a list of scalar variable names
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:Fluid temperature in each segment of this component. Takes a list of scalar variable names
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_onlyFalseWhether this object is only doing assembly to matrices (no vectors)
Default:False
C++ Type:bool
Controllable:No
Description:Whether this object is only doing assembly to matrices (no vectors)
- matrix_tagssystemThe tag for the matrices this Kernel should fill
Default:system
C++ Type:MultiMooseEnum
Options:nontime, system
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsnontimeThe tag for the vectors this Kernel should fill
Default:nontime
C++ Type:MultiMooseEnum
Options:nontime, time
Controllable:No
Description:The tag for the vectors this Kernel should fill
Contribution To Tagged Field Data Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADgrav.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/regular.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADregular_twoseg.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADfriction.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADheat_twoseg.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADfull_exp.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADregular_reverse.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADheat_exp.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/regular_twoseg.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADheatreverse.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADfull.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADforms.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/heatreverse.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/regular_reverse.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADheat_threeseg.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/full.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADpump.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/heat_threeseg.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADheat.i)
family
Default:LAGRANGE
C++ Type:MooseEnum
Options:LAGRANGE, MONOMIAL, HERMITE, SCALAR, HIERARCHIC, CLOUGH, XYZ, SZABAB, BERNSTEIN, L2_LAGRANGE, L2_HIERARCHIC, NEDELEC_ONE, LAGRANGE_VEC, MONOMIAL_VEC, RAVIART_THOMAS, RATIONAL_BERNSTEIN, SIDE_HIERARCHIC, L2_HIERARCHIC_VEC, L2_LAGRANGE_VEC, L2_RAVIART_THOMAS
Controllable:No
Description:Specifies the family of FE shape functions to use for this variable
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADgrav.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
rho = 998.2
mu = 0.001002
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'mdot / ${area} * 2 * ${R} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[f]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon} / 2 / 3.7 / ${R} + 5.74 / Re ^ 0.9 ))^2)'
pp_names = 'Re'
execute_on = 'TIMESTEP_END'
[]
[analytical_mdot]
type = ParsedPostprocessor
expression = 'sqrt(-(${dP} + ${rho} * ${gravity} * ${length} * sin(${alpha}) - ${pump}) / (f * ${length} / 4 / ${R} / ${rho} / ${area}^2 + ${forms} / 2 / ${rho} / ${area}^2))'
pp_names = 'f'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_mdot - mdot)/analytical_mdot)'
pp_names = 'analytical_mdot mdot'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/regular.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
rho = 998.2
mu = 0.001002
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'mdot / ${area} * 2 * ${R} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[f]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon} / 2 / 3.7 / ${R} + 5.74 / Re ^ 0.9 ))^2)'
pp_names = 'Re'
execute_on = 'TIMESTEP_END'
[]
[analytical_mdot]
type = ParsedPostprocessor
expression = 'sqrt(-(${dP} + ${rho} * ${gravity} * ${length} * sin(${alpha}) - ${pump}) / (f * ${length} / 4 / ${R} / ${rho} / ${area}^2 + ${forms} / 2 / ${rho} / ${area}^2))'
pp_names = 'f'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_mdot - mdot)/analytical_mdot)'
pp_names = 'analytical_mdot mdot'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADregular_twoseg.i)
length1 = 1.0
length2 = 2.0
R1 = 0.025
R2 = 0.05
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
rho = 998.2
mu = 0.001002
alpha1 = 0.0
alpha2 = '${fparse 3.14159/2}'
epsilon1 = 0.0001
epsilon2 = 0.0002
forms1 = 0.0
forms2 = 1.0
pump1 = '${fparse - ${dP}}'
pump2 = 0.0
gravity = 9.81
area1 = '${fparse 3.14159* ${R1}^2}'
area2 = '${fparse 3.14159* ${R2}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length1}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1 T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area1} ${area2}'
perimeters = '${fparse 2*3.14159* ${R1}} ${fparse 2*3.14159* ${R2}}'
lengths = '${length1} ${length2}'
alphas = '${alpha1} ${alpha2}'
forms_losses = '${forms1} ${forms2}'
pump_pressures = '${pump1} ${pump2}'
roughnesses = '${epsilon1} ${epsilon2}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re1]
type = ParsedPostprocessor
expression = 'mdot / ${area1} * 2 * ${R1} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[Re2]
type = ParsedPostprocessor
expression = 'mdot / ${area2} * 2 * ${R2} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[f1]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon1} / 2 / 3.7 / ${R1} + 5.74 / Re1 ^ 0.9 ))^2)'
pp_names = 'Re1'
execute_on = 'TIMESTEP_END'
[]
[f2]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon2} / 2 / 3.7 / ${R2} + 5.74 / Re2 ^ 0.9 ))^2)'
pp_names = 'Re2'
execute_on = 'TIMESTEP_END'
[]
[analytical_mdot]
type = ParsedPostprocessor
expression = 'sqrt(-(${dP} + ${rho} * ${gravity} * ${length1} * sin(${alpha1})
+ ${rho} * ${gravity} * ${length2} * sin(${alpha2})
- ${pump1} - ${pump2})
/ (f1 * ${length1} / 4 / ${R1} / ${rho} / ${area1}^2
+ f2 * ${length2} / 4 / ${R2} / ${rho} / ${area2}^2
+ ${forms1} / 2 / ${rho} / ${area1}^2
+ ${forms2} / 2 / ${rho} / ${area2}^2))'
pp_names = 'f1 f2'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_mdot - mdot)/analytical_mdot)'
pp_names = 'analytical_mdot mdot'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADfriction.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
rho = 998.2
mu = 0.001002
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'mdot / ${area} * 2 * ${R} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[f]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon} / 2 / 3.7 / ${R} + 5.74 / Re ^ 0.9 ))^2)'
pp_names = 'Re'
execute_on = 'TIMESTEP_END'
[]
[analytical_mdot]
type = ParsedPostprocessor
expression = 'sqrt(-(${dP} + ${rho} * ${gravity} * ${length} * sin(${alpha}) - ${pump}) / (f * ${length} / 4 / ${R} / ${rho} / ${area}^2 + ${forms} / 2 / ${rho} / ${area}^2))'
pp_names = 'f'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_mdot - mdot)/analytical_mdot)'
pp_names = 'analytical_mdot mdot'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADheat_twoseg.i)
length1 = 1.0
length2 = 2.0
R1 = 0.025
R2 = 0.05
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
Tout = 343.15
mu = 0.001002
cp = 4185.0
k = 0.598
alpha1 = 0.0
alpha2 = '${fparse 3.14159/2}'
epsilon1 = 0.0001
epsilon2 = 0.0002
forms1 = 0.0
forms2 = 1.0
pump1 = '${fparse - ${dP}}'
pump2 = 0.0
gravity = 9.81
area1 = '${fparse 3.14159* ${R1}^2}'
area2 = '${fparse 3.14159* ${R2}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length1}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T0]
family = SCALAR
initial_condition = ${Tin}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[Tw1]
family = SCALAR
initial_condition = ${Tout}
[]
[T2]
family = SCALAR
initial_condition = ${Tout}
[]
[Tw2]
family = SCALAR
initial_condition = ${Tout}
[]
[T3]
family = SCALAR
initial_condition = ${Tout}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1 T2'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area1} ${area2}'
perimeters = '${fparse 2*3.14159* ${R1}} ${fparse 2*3.14159* ${R2}}'
lengths = '${length1} ${length2}'
alphas = '${alpha1} ${alpha2}'
forms_losses = '${forms1} ${forms2}'
pump_pressures = '${pump1} ${pump2}'
roughnesses = '${epsilon1} ${epsilon2}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp1]
type = IncompressibleEnergySPScalarKernel
mass_flow_rate = 'm1'
inlet_temperature = 'T0'
outlet_temperature = 'T2'
wall_temperature = 'Tw1'
area = ${area1}
fp = water
length = ${length1}
perimeter = '${fparse 2*3.14159* ${R1}}'
reference_pressure = ${Pin}
variable = T1
is_implicit = True
[]
[temp1_DT]
type = ODETimeDerivative
variable = 'T1'
[]
[temp0]
type = ParsedODEKernel
expression = 'T0 - ${Tin}'
variable = T0
[]
[temp2]
type = IncompressibleEnergySPScalarKernel
mass_flow_rate = 'm1'
inlet_temperature = 'T1'
outlet_temperature = 'T3'
wall_temperature = 'Tw2'
area = ${area2}
fp = water
length = ${length2}
perimeter = '${fparse 2*3.14159* ${R2}}'
reference_pressure = ${Pin}
variable = T2
is_implicit = True
[]
[temp2_DT]
type = ODETimeDerivative
variable = 'T2'
[]
[temp3]
type = ParsedODEKernel
expression = 'T3 - ${Tout}'
variable = T3
[]
[walltemp1]
type = ParsedODEKernel
expression = 'Tw1 - ${Tout}'
variable = Tw1
[]
[walltemp2]
type = ParsedODEKernel
expression = 'Tw2 - ${Tout}'
variable = Tw2
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[Tone]
type = ScalarVariable
variable = T1
execute_on = 'TIMESTEP_END'
[]
[Ttwo]
type = ScalarVariable
variable = T2
execute_on = 'TIMESTEP_END'
[]
[M]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re1]
type = ParsedPostprocessor
expression = 'abs(M) / ${area1} * 2 * ${R1} / ${mu}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[Re2]
type = ParsedPostprocessor
expression = 'abs(M) / ${area2} * 2 * ${R2} / ${mu}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[Pr]
type = ParsedPostprocessor
expression = '${cp} * ${mu} / ${k}'
execute_on = 'TIMESTEP_END'
[]
[h1]
type = ParsedPostprocessor
expression = '0.023 * Re1^0.8 * Pr^0.4'
pp_names = 'Re1 Pr'
execute_on = 'TIMESTEP_END'
[]
[h2]
type = ParsedPostprocessor
expression = '0.023 * Re2^0.8 * Pr^0.4'
pp_names = 'Re2 Pr'
execute_on = 'TIMESTEP_END'
[]
[in1]
type = ParsedPostprocessor
expression = '1 / 2 * (1 - abs(M)/M) * Ttwo
+ 1 / 2 * (1 + abs(M)/M) * ${Tin}'
pp_names = 'Ttwo M'
execute_on = 'TIMESTEP_END'
[]
[in2]
type = ParsedPostprocessor
expression = '1 / 2 * (1 - abs(M)/M) * ${Tout}
+ 1 / 2 * (1 + abs(M)/M) * Tone'
pp_names = 'Tone M'
execute_on = 'TIMESTEP_END'
[]
[q1]
type = ParsedPostprocessor
expression = 'h1 * ${fparse 2*3.14159* ${R1}} / 2 * ( 2 * ${Tout} - Tone - in1)'
pp_names = 'Tone h1 in1'
execute_on = 'TIMESTEP_END'
[]
[q2]
type = ParsedPostprocessor
expression = 'h2 * ${fparse 2*3.14159* ${R2}} / 2 * ( 2 * ${Tout} - Ttwo - in2)'
pp_names = 'Ttwo h2 in2'
execute_on = 'TIMESTEP_END'
[]
[analytical_T1]
type = ParsedPostprocessor
expression = '1 / abs(M) / ${cp} * (q1 * ${length1} - M / 2 * (1 - abs(M)/M) * ${cp} * Ttwo
+ M / 2 * (1 + abs(M)/M) * ${cp} * ${Tin})'
pp_names = 'Ttwo q1 M'
[]
[analytical_T2]
type = ParsedPostprocessor
expression = '1 / abs(M) / ${cp} * (q2 * ${length2} - M / 2 * (1 - abs(M)/M) * ${cp} * ${Tout}
+ M / 2 * (1 + abs(M)/M) * ${cp} * Tone)'
pp_names = 'Tone q2 M'
[]
[relative_error1]
type = ParsedPostprocessor
expression = 'abs((analytical_T1 - Tone)/analytical_T1)'
pp_names = 'analytical_T1 Tone'
execute_on = 'TIMESTEP_END'
[]
[relative_error2]
type = ParsedPostprocessor
expression = 'abs((analytical_T2 - Ttwo)/analytical_T2)'
pp_names = 'analytical_T2 Ttwo'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADfull_exp.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
rho = 998.2
mu = 0.001002
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'mdot / ${area} * 2 * ${R} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[f]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon} / 2 / 3.7 / ${R} + 5.74 / Re ^ 0.9 ))^2)'
pp_names = 'Re'
execute_on = 'TIMESTEP_END'
[]
[analytical_mdot]
type = ParsedPostprocessor
expression = 'sqrt(-(${dP} + ${rho} * ${gravity} * ${length} * sin(${alpha}) - ${pump}) / (f * ${length} / 4 / ${R} / ${rho} / ${area}^2 + ${forms} / 2 / ${rho} / ${area}^2))'
pp_names = 'f'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_mdot - mdot)/analytical_mdot)'
pp_names = 'analytical_mdot mdot'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADregular_reverse.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
rho = 998.2
mu = 0.001002
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'abs(mdot) / ${area} * 2 * ${R} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[f]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon} / 2 / 3.7 / ${R} + 5.74 / Re ^ 0.9 ))^2)'
pp_names = 'Re'
execute_on = 'TIMESTEP_END'
[]
[analytical_mdot]
type = ParsedPostprocessor
expression = '-sqrt(abs(-(${dP} + ${rho} * ${gravity} * ${length} * sin(${alpha}) - ${pump}) / (f * ${length} / 4 / ${R} / ${rho} / ${area}^2 + ${forms} / 2 / ${rho} / ${area}^2)))'
pp_names = 'f'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_mdot - mdot)/analytical_mdot)'
pp_names = 'analytical_mdot mdot'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADheat_exp.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
Tout = 323.15
mu = 0.001002
cp = 4185.0
k = 0.598
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T0]
family = SCALAR
initial_condition = ${Tin}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[Tw]
family = SCALAR
initial_condition = ${Tout}
[]
[T2]
family = SCALAR
initial_condition = ${Tout}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp1]
type = IncompressibleEnergySPScalarKernel
mass_flow_rate = 'm1'
inlet_temperature = 'T0'
outlet_temperature = 'T2'
wall_temperature = 'Tw'
area = ${area}
fp = water
length = ${length}
perimeter = '${fparse 2*3.14159* ${R}}'
reference_pressure = ${Pin}
variable = T1
is_implicit = True
[]
[temp1_DT]
type = ODETimeDerivative
variable = 'T1'
[]
[temp0]
type = ParsedODEKernel
expression = 'T0 - ${Tin}'
variable = T0
[]
[temp2]
type = ParsedODEKernel
expression = 'T2 - ${Tout}'
variable = T2
[]
[walltemp]
type = ParsedODEKernel
expression = 'Tw - ${Tout}'
variable = Tw
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[T]
type = ScalarVariable
variable = T1
execute_on = 'TIMESTEP_END'
[]
[M]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'abs(M) / ${area} * 2 * ${R} / ${mu}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[Pr]
type = ParsedPostprocessor
expression = '${cp} * ${mu} / ${k}'
execute_on = 'TIMESTEP_END'
[]
[h]
type = ParsedPostprocessor
expression = '0.023 * Re^0.8 * Pr^0.4'
pp_names = 'Re Pr'
execute_on = 'TIMESTEP_END'
[]
[in]
type = ParsedPostprocessor
expression = '1 / 2 * (1 - abs(M)/M) * ${Tout}
+ 1 / 2 * (1 + abs(M)/M) * ${Tin}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[q]
type = ParsedPostprocessor
expression = 'h * ${fparse 2*3.14159* ${R}} / 2 * ( 2 * ${Tout} - T - in)'
pp_names = 'T h in'
execute_on = 'TIMESTEP_END'
[]
[analytical_T]
type = ParsedPostprocessor
expression = '1 / abs(M) / ${cp} * (q * ${length} - M / 2 * (1 - abs(M)/M) * ${cp} * ${Tout}
+ M / 2 * (1 + abs(M)/M) * ${cp} * ${Tin}) '
pp_names = 'T q M'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_T - T)/analytical_T)'
pp_names = 'analytical_T T'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-08
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/regular_twoseg.i)
length1 = 1.0
length2 = 2.0
R1 = 0.025
R2 = 0.05
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
rho = 998.2
mu = 0.001002
alpha1 = 0.0
alpha2 = '${fparse 3.14159/2}'
epsilon1 = 0.0001
epsilon2 = 0.0002
forms1 = 0.0
forms2 = 1.0
pump1 = '${fparse - ${dP}}'
pump2 = 0.0
gravity = 9.81
area1 = '${fparse 3.14159* ${R1}^2}'
area2 = '${fparse 3.14159* ${R2}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length1}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1 T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area1} ${area2}'
perimeters = '${fparse 2*3.14159* ${R1}} ${fparse 2*3.14159* ${R2}}'
lengths = '${length1} ${length2}'
alphas = '${alpha1} ${alpha2}'
forms_losses = '${forms1} ${forms2}'
pump_pressures = '${pump1} ${pump2}'
roughnesses = '${epsilon1} ${epsilon2}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re1]
type = ParsedPostprocessor
expression = 'mdot / ${area1} * 2 * ${R1} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[Re2]
type = ParsedPostprocessor
expression = 'mdot / ${area2} * 2 * ${R2} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[f1]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon1} / 2 / 3.7 / ${R1} + 5.74 / Re1 ^ 0.9 ))^2)'
pp_names = 'Re1'
execute_on = 'TIMESTEP_END'
[]
[f2]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon2} / 2 / 3.7 / ${R2} + 5.74 / Re2 ^ 0.9 ))^2)'
pp_names = 'Re2'
execute_on = 'TIMESTEP_END'
[]
[analytical_mdot]
type = ParsedPostprocessor
expression = 'sqrt(-(${dP} + ${rho} * ${gravity} * ${length1} * sin(${alpha1})
+ ${rho} * ${gravity} * ${length2} * sin(${alpha2})
- ${pump1} - ${pump2})
/ (f1 * ${length1} / 4 / ${R1} / ${rho} / ${area1}^2
+ f2 * ${length2} / 4 / ${R2} / ${rho} / ${area2}^2
+ ${forms1} / 2 / ${rho} / ${area1}^2
+ ${forms2} / 2 / ${rho} / ${area2}^2))'
pp_names = 'f1 f2'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_mdot - mdot)/analytical_mdot)'
pp_names = 'analytical_mdot mdot'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADheatreverse.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 323.15
Tout = 293.15
mu = 0.001002
cp = 4185.0
k = 0.598
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T0]
family = SCALAR
initial_condition = ${Tin}
[]
[T1]
family = SCALAR
initial_condition = ${Tout}
[]
[Tw]
family = SCALAR
initial_condition = ${Tin}
[]
[T2]
family = SCALAR
initial_condition = ${Tout}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp1]
type = IncompressibleEnergySPScalarKernel
mass_flow_rate = 'm1'
inlet_temperature = 'T0'
outlet_temperature = 'T2'
wall_temperature = 'Tw'
area = ${area}
fp = water
length = ${length}
perimeter = '${fparse 2*3.14159* ${R}}'
reference_pressure = ${Pin}
variable = T1
is_implicit = True
[]
[temp1_DT]
type = ODETimeDerivative
variable = 'T1'
[]
[temp0]
type = ParsedODEKernel
expression = 'T0 - ${Tin}'
variable = T0
[]
[temp2]
type = ParsedODEKernel
expression = 'T2 - ${Tout}'
variable = T2
[]
[walltemp]
type = ParsedODEKernel
expression = 'Tw - ${Tin}'
variable = Tw
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[T]
type = ScalarVariable
variable = T1
execute_on = 'TIMESTEP_END'
[]
[M]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'abs(M) / ${area} * 2 * ${R} / ${mu}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[Pr]
type = ParsedPostprocessor
expression = '${cp} * ${mu} / ${k}'
execute_on = 'TIMESTEP_END'
[]
[h]
type = ParsedPostprocessor
expression = '0.023 * Re^0.8 * Pr^0.4'
pp_names = 'Re Pr'
execute_on = 'TIMESTEP_END'
[]
[in]
type = ParsedPostprocessor
expression = '1 / 2 * (1 - abs(M)/M) * ${Tout}
+ 1 / 2 * (1 + abs(M)/M) * ${Tin}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[q]
type = ParsedPostprocessor
expression = 'h * ${fparse 2*3.14159* ${R}} / 2 * ( 2 * ${Tin} - T - in)'
pp_names = 'T h in'
execute_on = 'TIMESTEP_END'
[]
[analytical_T]
type = ParsedPostprocessor
expression = '1 / abs(M) / ${cp} * (q * ${length} - M / 2 * (1 - abs(M)/M) * ${cp} * ${Tout}
+ M / 2 * (1 + abs(M)/M) * ${cp} * ${Tin}) '
pp_names = 'T q M'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_T - T)/analytical_T)'
pp_names = 'analytical_T T'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
line_search = 'none'
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-08
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADfull.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
rho = 998.2
mu = 0.001002
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'mdot / ${area} * 2 * ${R} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[f]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon} / 2 / 3.7 / ${R} + 5.74 / Re ^ 0.9 ))^2)'
pp_names = 'Re'
execute_on = 'TIMESTEP_END'
[]
[analytical_mdot]
type = ParsedPostprocessor
expression = 'sqrt(-(${dP} + ${rho} * ${gravity} * ${length} * sin(${alpha}) - ${pump}) / (f * ${length} / 4 / ${R} / ${rho} / ${area}^2 + ${forms} / 2 / ${rho} / ${area}^2))'
pp_names = 'f'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_mdot - mdot)/analytical_mdot)'
pp_names = 'analytical_mdot mdot'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADforms.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
rho = 998.2
mu = 0.001002
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'mdot / ${area} * 2 * ${R} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[f]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon} / 2 / 3.7 / ${R} + 5.74 / Re ^ 0.9 ))^2)'
pp_names = 'Re'
execute_on = 'TIMESTEP_END'
[]
[analytical_mdot]
type = ParsedPostprocessor
expression = 'sqrt(-(${dP} + ${rho} * ${gravity} * ${length} * sin(${alpha}) - ${pump}) / (f * ${length} / 4 / ${R} / ${rho} / ${area}^2 + ${forms} / 2 / ${rho} / ${area}^2))'
pp_names = 'f'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_mdot - mdot)/analytical_mdot)'
pp_names = 'analytical_mdot mdot'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/heatreverse.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 323.15
Tout = 293.15
mu = 0.001002
cp = 4185.0
k = 0.598
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T0]
family = SCALAR
initial_condition = ${Tin}
[]
[T1]
family = SCALAR
initial_condition = ${Tout}
[]
[Tw]
family = SCALAR
initial_condition = ${Tin}
[]
[T2]
family = SCALAR
initial_condition = ${Tout}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp1]
type = IncompressibleEnergySPScalarKernel
mass_flow_rate = 'm1'
inlet_temperature = 'T0'
outlet_temperature = 'T2'
wall_temperature = 'Tw'
area = ${area}
fp = water
length = ${length}
perimeter = '${fparse 2*3.14159* ${R}}'
reference_pressure = ${Pin}
variable = T1
is_implicit = True
[]
[temp1_DT]
type = ODETimeDerivative
variable = 'T1'
[]
[temp0]
type = ParsedODEKernel
expression = 'T0 - ${Tin}'
variable = T0
[]
[temp2]
type = ParsedODEKernel
expression = 'T2 - ${Tout}'
variable = T2
[]
[walltemp]
type = ParsedODEKernel
expression = 'Tw - ${Tin}'
variable = Tw
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[T]
type = ScalarVariable
variable = T1
execute_on = 'TIMESTEP_END'
[]
[M]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'abs(M) / ${area} * 2 * ${R} / ${mu}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[Pr]
type = ParsedPostprocessor
expression = '${cp} * ${mu} / ${k}'
execute_on = 'TIMESTEP_END'
[]
[h]
type = ParsedPostprocessor
expression = '0.023 * Re^0.8 * Pr^0.4'
pp_names = 'Re Pr'
execute_on = 'TIMESTEP_END'
[]
[in]
type = ParsedPostprocessor
expression = '1 / 2 * (1 - abs(M)/M) * ${Tout}
+ 1 / 2 * (1 + abs(M)/M) * ${Tin}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[q]
type = ParsedPostprocessor
expression = 'h * ${fparse 2*3.14159* ${R}} / 2 * ( 2 * ${Tin} - T - in)'
pp_names = 'T h in'
execute_on = 'TIMESTEP_END'
[]
[analytical_T]
type = ParsedPostprocessor
expression = '1 / abs(M) / ${cp} * (q * ${length} - M / 2 * (1 - abs(M)/M) * ${cp} * ${Tout}
+ M / 2 * (1 + abs(M)/M) * ${cp} * ${Tin}) '
pp_names = 'T q M'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_T - T)/analytical_T)'
pp_names = 'analytical_T T'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
line_search = 'none'
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-08
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/regular_reverse.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
rho = 998.2
mu = 0.001002
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'abs(mdot) / ${area} * 2 * ${R} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[f]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon} / 2 / 3.7 / ${R} + 5.74 / Re ^ 0.9 ))^2)'
pp_names = 'Re'
execute_on = 'TIMESTEP_END'
[]
[analytical_mdot]
type = ParsedPostprocessor
expression = '-sqrt(abs(-(${dP} + ${rho} * ${gravity} * ${length} * sin(${alpha}) - ${pump}) / (f * ${length} / 4 / ${R} / ${rho} / ${area}^2 + ${forms} / 2 / ${rho} / ${area}^2)))'
pp_names = 'f'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_mdot - mdot)/analytical_mdot)'
pp_names = 'analytical_mdot mdot'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADheat_threeseg.i)
length1 = 1.0
length2 = 1.0
length3 = 1.0
R1 = 0.025
R2 = 0.05
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
Tout = 343.15
mu = 0.001002
cp = 4185.0
k = 0.598
alpha1 = 0.0
alpha2 = '${fparse 3.14159/2}'
epsilon1 = 0.0001
epsilon2 = 0.0002
forms1 = 0.0
forms2 = 1.0
pump1 = '${fparse - ${dP}}'
pump2 = 0.0
gravity = 9.81
area1 = '${fparse 3.14159* ${R1}^2}'
area2 = '${fparse 3.14159* ${R2}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length1}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T0]
family = SCALAR
initial_condition = ${Tin}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[Tw1]
family = SCALAR
initial_condition = ${Tout}
[]
[T2]
family = SCALAR
initial_condition = ${Tout}
[]
[Tw2]
family = SCALAR
initial_condition = ${Tout}
[]
[T3]
family = SCALAR
initial_condition = ${Tout}
[]
[Tw3]
family = SCALAR
initial_condition = ${Tout}
[]
[T4]
family = SCALAR
initial_condition = ${Tout}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1 T2 T3'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area1} ${area2} ${area2}'
perimeters = '${fparse 2*3.14159* ${R1}} ${fparse 2*3.14159* ${R2}} ${fparse 2*3.14159* ${R2}}'
lengths = '${length1} ${length2} ${length2}'
alphas = '${alpha1} ${alpha2} ${alpha2}'
forms_losses = '${forms1} ${forms2} ${forms2}'
pump_pressures = '${pump1} ${pump2} ${pump2}'
roughnesses = '${epsilon1} ${epsilon2} ${epsilon2}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp0]
type = ParsedODEKernel
expression = 'T0 - ${Tin}'
variable = T0
[]
[temp1]
type = IncompressibleEnergySPScalarKernel
mass_flow_rate = 'm1'
inlet_temperature = 'T0'
outlet_temperature = 'T2'
wall_temperature = 'Tw1'
area = ${area1}
fp = water
length = ${length1}
perimeter = '${fparse 2*3.14159* ${R1}}'
reference_pressure = ${Pin}
variable = T1
is_implicit = True
[]
[temp1_DT]
type = ODETimeDerivative
variable = 'T1'
[]
[temp2]
type = IncompressibleEnergySPScalarKernel
mass_flow_rate = 'm1'
inlet_temperature = 'T1'
outlet_temperature = 'T3'
wall_temperature = 'Tw2'
area = ${area2}
fp = water
length = ${length2}
perimeter = '${fparse 2*3.14159* ${R2}}'
reference_pressure = ${Pin}
variable = T2
is_implicit = True
[]
[temp2_DT]
type = ODETimeDerivative
variable = 'T2'
[]
[temp3]
type = IncompressibleEnergySPScalarKernel
mass_flow_rate = 'm1'
inlet_temperature = 'T2'
outlet_temperature = 'T4'
wall_temperature = 'Tw3'
area = ${area2}
fp = water
length = ${length3}
perimeter = '${fparse 2*3.14159* ${R2}}'
reference_pressure = ${Pin}
variable = T3
is_implicit = True
[]
[temp3_DT]
type = ODETimeDerivative
variable = 'T3'
[]
[temp4]
type = ParsedODEKernel
expression = 'T4 - ${Tout}'
variable = T4
[]
[walltemp1]
type = ParsedODEKernel
expression = 'Tw1 - ${Tout}'
variable = Tw1
[]
[walltemp2]
type = ParsedODEKernel
expression = 'Tw2 - ${Tout}'
variable = Tw2
[]
[walltemp3]
type = ParsedODEKernel
expression = 'Tw3 - ${Tout}'
variable = Tw3
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[Tone]
type = ScalarVariable
variable = T1
execute_on = 'TIMESTEP_END'
[]
[Ttwo]
type = ScalarVariable
variable = T2
execute_on = 'TIMESTEP_END'
[]
[Tthree]
type = ScalarVariable
variable = T3
execute_on = 'TIMESTEP_END'
[]
[M]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re1]
type = ParsedPostprocessor
expression = 'abs(M) / ${area1} * 2 * ${R1} / ${mu}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[Re2]
type = ParsedPostprocessor
expression = 'abs(M) / ${area2} * 2 * ${R2} / ${mu}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[Pr]
type = ParsedPostprocessor
expression = '${cp} * ${mu} / ${k}'
execute_on = 'TIMESTEP_END'
[]
[h1]
type = ParsedPostprocessor
expression = '0.023 * Re1^0.8 * Pr^0.4'
pp_names = 'Re1 Pr'
execute_on = 'TIMESTEP_END'
[]
[h2]
type = ParsedPostprocessor
expression = '0.023 * Re2^0.8 * Pr^0.4'
pp_names = 'Re2 Pr'
execute_on = 'TIMESTEP_END'
[]
[in1]
type = ParsedPostprocessor
expression = '1 / 2 * (1 - abs(M)/M) * Ttwo
+ 1 / 2 * (1 + abs(M)/M) * ${Tin}'
pp_names = 'Ttwo M'
execute_on = 'TIMESTEP_END'
[]
[in2]
type = ParsedPostprocessor
expression = '1 / 2 * (1 - abs(M)/M) * Tthree
+ 1 / 2 * (1 + abs(M)/M) * Tone'
pp_names = 'Tone Tthree M'
execute_on = 'TIMESTEP_END'
[]
[in3]
type = ParsedPostprocessor
expression = '1 / 2 * (1 - abs(M)/M) * ${Tout}
+ 1 / 2 * (1 + abs(M)/M) * Ttwo'
pp_names = 'Ttwo M'
execute_on = 'TIMESTEP_END'
[]
[q1]
type = ParsedPostprocessor
expression = 'h1 * ${fparse 2*3.14159* ${R1}} / 2 * ( 2 * ${Tout} - Tone - in1)'
pp_names = 'Tone h1 in1'
execute_on = 'TIMESTEP_END'
[]
[q2]
type = ParsedPostprocessor
expression = 'h2 * ${fparse 2*3.14159* ${R2}} / 2 * ( 2 * ${Tout} - Ttwo - in2)'
pp_names = 'Ttwo h2 in2'
execute_on = 'TIMESTEP_END'
[]
[q3]
type = ParsedPostprocessor
expression = 'h2 * ${fparse 2*3.14159* ${R2}} / 2 * ( 2 * ${Tout} - Tthree - in3)'
pp_names = 'Tthree h2 in3'
execute_on = 'TIMESTEP_END'
[]
[analytical_T1]
type = ParsedPostprocessor
expression = '1 / abs(M) / ${cp} * (q1 * ${length1} - M / 2 * (1 - abs(M)/M) * ${cp} * Ttwo
+ M / 2 * (1 + abs(M)/M) * ${cp} * ${Tin})'
pp_names = 'Ttwo q1 M'
[]
[analytical_T2]
type = ParsedPostprocessor
expression = '1 / abs(M) / ${cp} * (q2 * ${length2} - M / 2 * (1 - abs(M)/M) * ${cp} * Tthree
+ M / 2 * (1 + abs(M)/M) * ${cp} * Tone)'
pp_names = 'Tone Tthree q2 M'
[]
[analytical_T3]
type = ParsedPostprocessor
expression = '1 / abs(M) / ${cp} * (q3 * ${length3} - M / 2 * (1 - abs(M)/M) * ${cp} * ${Tout}
+ M / 2 * (1 + abs(M)/M) * ${cp} * Ttwo)'
pp_names = 'Ttwo q3 M'
[]
[relative_error1]
type = ParsedPostprocessor
expression = 'abs((analytical_T1 - Tone)/analytical_T1)'
pp_names = 'analytical_T1 Tone'
execute_on = 'TIMESTEP_END'
[]
[relative_error2]
type = ParsedPostprocessor
expression = 'abs((analytical_T2 - Ttwo)/analytical_T2)'
pp_names = 'analytical_T2 Ttwo'
execute_on = 'TIMESTEP_END'
[]
[relative_error3]
type = ParsedPostprocessor
expression = 'abs((analytical_T3 - Tthree)/analytical_T3)'
pp_names = 'analytical_T3 Tthree'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/full.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
rho = 998.2
mu = 0.001002
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'mdot / ${area} * 2 * ${R} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[f]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon} / 2 / 3.7 / ${R} + 5.74 / Re ^ 0.9 ))^2)'
pp_names = 'Re'
execute_on = 'TIMESTEP_END'
[]
[analytical_mdot]
type = ParsedPostprocessor
expression = 'sqrt(-(${dP} + ${rho} * ${gravity} * ${length} * sin(${alpha}) - ${pump}) / (f * ${length} / 4 / ${R} / ${rho} / ${area}^2 + ${forms} / 2 / ${rho} / ${area}^2))'
pp_names = 'f'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_mdot - mdot)/analytical_mdot)'
pp_names = 'analytical_mdot mdot'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADpump.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
rho = 998.2
mu = 0.001002
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'mdot / ${area} * 2 * ${R} / ${mu}'
pp_names = 'mdot'
execute_on = 'TIMESTEP_END'
[]
[f]
type = ParsedPostprocessor
expression = '0.25 / ((log10(${epsilon} / 2 / 3.7 / ${R} + 5.74 / Re ^ 0.9 ))^2)'
pp_names = 'Re'
execute_on = 'TIMESTEP_END'
[]
[analytical_mdot]
type = ParsedPostprocessor
expression = 'sqrt(-(${dP} + ${rho} * ${gravity} * ${length} * sin(${alpha}) - ${pump}) / (f * ${length} / 4 / ${R} / ${rho} / ${area}^2 + ${forms} / 2 / ${rho} / ${area}^2))'
pp_names = 'f'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_mdot - mdot)/analytical_mdot)'
pp_names = 'analytical_mdot mdot'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-09
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/heat_threeseg.i)
length1 = 1.0
length2 = 1.0
length3 = 1.0
R1 = 0.025
R2 = 0.05
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
Tout = 343.15
mu = 0.001002
cp = 4185.0
k = 0.598
alpha1 = 0.0
alpha2 = '${fparse 3.14159/2}'
epsilon1 = 0.0001
epsilon2 = 0.0002
forms1 = 0.0
forms2 = 1.0
pump1 = '${fparse - ${dP}}'
pump2 = 0.0
gravity = 9.81
area1 = '${fparse 3.14159* ${R1}^2}'
area2 = '${fparse 3.14159* ${R2}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length1}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T0]
family = SCALAR
initial_condition = ${Tin}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[Tw1]
family = SCALAR
initial_condition = ${Tout}
[]
[T2]
family = SCALAR
initial_condition = ${Tout}
[]
[Tw2]
family = SCALAR
initial_condition = ${Tout}
[]
[T3]
family = SCALAR
initial_condition = ${Tout}
[]
[Tw3]
family = SCALAR
initial_condition = ${Tout}
[]
[T4]
family = SCALAR
initial_condition = ${Tout}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1 T2 T3'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area1} ${area2} ${area2}'
perimeters = '${fparse 2*3.14159* ${R1}} ${fparse 2*3.14159* ${R2}} ${fparse 2*3.14159* ${R2}}'
lengths = '${length1} ${length2} ${length2}'
alphas = '${alpha1} ${alpha2} ${alpha2}'
forms_losses = '${forms1} ${forms2} ${forms2}'
pump_pressures = '${pump1} ${pump2} ${pump2}'
roughnesses = '${epsilon1} ${epsilon2} ${epsilon2}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp0]
type = ParsedODEKernel
expression = 'T0 - ${Tin}'
variable = T0
[]
[temp1]
type = IncompressibleEnergySPScalarKernel
mass_flow_rate = 'm1'
inlet_temperature = 'T0'
outlet_temperature = 'T2'
wall_temperature = 'Tw1'
area = ${area1}
fp = water
length = ${length1}
perimeter = '${fparse 2*3.14159* ${R1}}'
reference_pressure = ${Pin}
variable = T1
is_implicit = True
[]
[temp1_DT]
type = ODETimeDerivative
variable = 'T1'
[]
[temp2]
type = IncompressibleEnergySPScalarKernel
mass_flow_rate = 'm1'
inlet_temperature = 'T1'
outlet_temperature = 'T3'
wall_temperature = 'Tw2'
area = ${area2}
fp = water
length = ${length2}
perimeter = '${fparse 2*3.14159* ${R2}}'
reference_pressure = ${Pin}
variable = T2
is_implicit = True
[]
[temp2_DT]
type = ODETimeDerivative
variable = 'T2'
[]
[temp3]
type = IncompressibleEnergySPScalarKernel
mass_flow_rate = 'm1'
inlet_temperature = 'T2'
outlet_temperature = 'T4'
wall_temperature = 'Tw3'
area = ${area2}
fp = water
length = ${length3}
perimeter = '${fparse 2*3.14159* ${R2}}'
reference_pressure = ${Pin}
variable = T3
is_implicit = True
[]
[temp3_DT]
type = ODETimeDerivative
variable = 'T3'
[]
[temp4]
type = ParsedODEKernel
expression = 'T4 - ${Tout}'
variable = T4
[]
[walltemp1]
type = ParsedODEKernel
expression = 'Tw1 - ${Tout}'
variable = Tw1
[]
[walltemp2]
type = ParsedODEKernel
expression = 'Tw2 - ${Tout}'
variable = Tw2
[]
[walltemp3]
type = ParsedODEKernel
expression = 'Tw3 - ${Tout}'
variable = Tw3
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[Tone]
type = ScalarVariable
variable = T1
execute_on = 'TIMESTEP_END'
[]
[Ttwo]
type = ScalarVariable
variable = T2
execute_on = 'TIMESTEP_END'
[]
[Tthree]
type = ScalarVariable
variable = T3
execute_on = 'TIMESTEP_END'
[]
[M]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re1]
type = ParsedPostprocessor
expression = 'abs(M) / ${area1} * 2 * ${R1} / ${mu}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[Re2]
type = ParsedPostprocessor
expression = 'abs(M) / ${area2} * 2 * ${R2} / ${mu}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[Pr]
type = ParsedPostprocessor
expression = '${cp} * ${mu} / ${k}'
execute_on = 'TIMESTEP_END'
[]
[h1]
type = ParsedPostprocessor
expression = '0.023 * Re1^0.8 * Pr^0.4'
pp_names = 'Re1 Pr'
execute_on = 'TIMESTEP_END'
[]
[h2]
type = ParsedPostprocessor
expression = '0.023 * Re2^0.8 * Pr^0.4'
pp_names = 'Re2 Pr'
execute_on = 'TIMESTEP_END'
[]
[in1]
type = ParsedPostprocessor
expression = '1 / 2 * (1 - abs(M)/M) * Ttwo
+ 1 / 2 * (1 + abs(M)/M) * ${Tin}'
pp_names = 'Ttwo M'
execute_on = 'TIMESTEP_END'
[]
[in2]
type = ParsedPostprocessor
expression = '1 / 2 * (1 - abs(M)/M) * Tthree
+ 1 / 2 * (1 + abs(M)/M) * Tone'
pp_names = 'Tone Tthree M'
execute_on = 'TIMESTEP_END'
[]
[in3]
type = ParsedPostprocessor
expression = '1 / 2 * (1 - abs(M)/M) * ${Tout}
+ 1 / 2 * (1 + abs(M)/M) * Ttwo'
pp_names = 'Ttwo M'
execute_on = 'TIMESTEP_END'
[]
[q1]
type = ParsedPostprocessor
expression = 'h1 * ${fparse 2*3.14159* ${R1}} / 2 * ( 2 * ${Tout} - Tone - in1)'
pp_names = 'Tone h1 in1'
execute_on = 'TIMESTEP_END'
[]
[q2]
type = ParsedPostprocessor
expression = 'h2 * ${fparse 2*3.14159* ${R2}} / 2 * ( 2 * ${Tout} - Ttwo - in2)'
pp_names = 'Ttwo h2 in2'
execute_on = 'TIMESTEP_END'
[]
[q3]
type = ParsedPostprocessor
expression = 'h2 * ${fparse 2*3.14159* ${R2}} / 2 * ( 2 * ${Tout} - Tthree - in3)'
pp_names = 'Tthree h2 in3'
execute_on = 'TIMESTEP_END'
[]
[analytical_T1]
type = ParsedPostprocessor
expression = '1 / abs(M) / ${cp} * (q1 * ${length1} - M / 2 * (1 - abs(M)/M) * ${cp} * Ttwo
+ M / 2 * (1 + abs(M)/M) * ${cp} * ${Tin})'
pp_names = 'Ttwo q1 M'
[]
[analytical_T2]
type = ParsedPostprocessor
expression = '1 / abs(M) / ${cp} * (q2 * ${length2} - M / 2 * (1 - abs(M)/M) * ${cp} * Tthree
+ M / 2 * (1 + abs(M)/M) * ${cp} * Tone)'
pp_names = 'Tone Tthree q2 M'
[]
[analytical_T3]
type = ParsedPostprocessor
expression = '1 / abs(M) / ${cp} * (q3 * ${length3} - M / 2 * (1 - abs(M)/M) * ${cp} * ${Tout}
+ M / 2 * (1 + abs(M)/M) * ${cp} * Ttwo)'
pp_names = 'Ttwo q3 M'
[]
[relative_error1]
type = ParsedPostprocessor
expression = 'abs((analytical_T1 - Tone)/analytical_T1)'
pp_names = 'analytical_T1 Tone'
execute_on = 'TIMESTEP_END'
[]
[relative_error2]
type = ParsedPostprocessor
expression = 'abs((analytical_T2 - Ttwo)/analytical_T2)'
pp_names = 'analytical_T2 Ttwo'
execute_on = 'TIMESTEP_END'
[]
[relative_error3]
type = ParsedPostprocessor
expression = 'abs((analytical_T3 - Tthree)/analytical_T3)'
pp_names = 'analytical_T3 Tthree'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-08
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADheat.i)
length = 1.0
R = 0.025
min = 1.0
Pin = 101300
dP = -10130
Tin = 293.15
Tout = 323.15
mu = 0.001002
cp = 4185.0
k = 0.598
alpha = 0.0
epsilon = 0.0001
forms = 0.0
pump = 0.0
gravity = 0.0
area = '${fparse 3.14159* ${R}^2}'
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = ${length}
nx = 1
[]
[Variables]
[m1]
family = SCALAR
initial_condition = ${min}
[]
[dPc]
family = SCALAR
initial_condition = ${dP}
[]
[T0]
family = SCALAR
initial_condition = ${Tin}
[]
[T1]
family = SCALAR
initial_condition = ${Tin}
[]
[Tw]
family = SCALAR
initial_condition = ${Tout}
[]
[T2]
family = SCALAR
initial_condition = ${Tout}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[ScalarKernels]
[pipe1_mom]
type = IncompressibleMomentumSPScalarKernel
variable = 'm1'
reference_pressure_drop = 'dPc'
temperatures = 'T1'
reference_pressure = ${Pin}
fp = 'water'
areas = '${area}'
perimeters = '${fparse 2*3.14159* ${R}}'
lengths = '${length}'
alphas = '${alpha}'
forms_losses = '${forms}'
pump_pressures = '${pump}'
roughnesses = '${epsilon}'
g = ${gravity}
is_implicit = True
[]
[pipe1_DT]
type = ODETimeDerivative
variable = 'm1'
[]
[temp1]
type = IncompressibleEnergySPScalarKernel
mass_flow_rate = 'm1'
inlet_temperature = 'T0'
outlet_temperature = 'T2'
wall_temperature = 'Tw'
area = ${area}
fp = water
length = ${length}
perimeter = '${fparse 2*3.14159* ${R}}'
reference_pressure = ${Pin}
variable = T1
is_implicit = True
[]
[temp1_DT]
type = ODETimeDerivative
variable = 'T1'
[]
[temp0]
type = ParsedODEKernel
expression = 'T0 - ${Tin}'
variable = T0
[]
[temp2]
type = ParsedODEKernel
expression = 'T2 - ${Tout}'
variable = T2
[]
[walltemp]
type = ParsedODEKernel
expression = 'Tw - ${Tout}'
variable = Tw
[]
[dPk]
type = ParsedODEKernel
expression = 'dPc - ${dP}'
variable = dPc
[]
[]
[Postprocessors]
[T]
type = ScalarVariable
variable = T1
execute_on = 'TIMESTEP_END'
[]
[M]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[Re]
type = ParsedPostprocessor
expression = 'abs(M) / ${area} * 2 * ${R} / ${mu}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[Pr]
type = ParsedPostprocessor
expression = '${cp} * ${mu} / ${k}'
execute_on = 'TIMESTEP_END'
[]
[h]
type = ParsedPostprocessor
expression = '0.023 * Re^0.8 * Pr^0.4'
pp_names = 'Re Pr'
execute_on = 'TIMESTEP_END'
[]
[in]
type = ParsedPostprocessor
expression = '1 / 2 * (1 - abs(M)/M) * ${Tout}
+ 1 / 2 * (1 + abs(M)/M) * ${Tin}'
pp_names = 'M'
execute_on = 'TIMESTEP_END'
[]
[q]
type = ParsedPostprocessor
expression = 'h * ${fparse 2*3.14159* ${R}} / 2 * ( 2 * ${Tout} - T - in)'
pp_names = 'T h in'
execute_on = 'TIMESTEP_END'
[]
[analytical_T]
type = ParsedPostprocessor
expression = '1 / abs(M) / ${cp} * (q * ${length} - M / 2 * (1 - abs(M)/M) * ${cp} * ${Tout}
+ M / 2 * (1 + abs(M)/M) * ${cp} * ${Tin}) '
pp_names = 'T q M'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_T - T)/analytical_T)'
pp_names = 'analytical_T T'
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 100.0
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.4
dt = 5
[]
solve_type = 'PJFNK'
nl_abs_tol = 1e-08
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]