- vCoupled variable.
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:Coupled variable.
- 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
CoupledODETimeDerivative
Residual contribution of ODE from the time derivative of a coupled variable.
The CoupledODETimeDerivative is similar to the ODETimeDerivative scalar kernel, except that the derivative acts on a different variable than the ODE is solved for.
Example input syntax
In this example, the scalar variables f and f_times_mult are the solutions to the coupled ODE problem:
The time derivative term for the first equation is added using a CoupledODETimeDerivative scalar kernel, as the first equation is set to have f as its nonlinear variable, even though f does not appear in it!
[ScalarKernels<<<{"href": "../../syntax/ScalarKernels/index.html"}>>>]
[./dT]
type = CoupledODETimeDerivative<<<{"description": "Residual contribution of ODE from the time derivative of a coupled variable.", "href": "CoupledODETimeDerivative.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = f
v<<<{"description": "Coupled variable."}>>> = f_times_mult
[../]
[./src]
type = ParsedODEKernel<<<{"description": "Parsed expression ODE kernel.", "href": "ParsedODEKernel.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = f
expression<<<{"description": "function expression"}>>> = '-1'
[../]
[./f_times_mult_1]
type = ParsedODEKernel<<<{"description": "Parsed expression ODE kernel.", "href": "ParsedODEKernel.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = f_times_mult
expression<<<{"description": "function expression"}>>> = 'f_times_mult'
[../]
[./f_times_mult_2]
type = ParsedODEKernel<<<{"description": "Parsed expression ODE kernel.", "href": "ParsedODEKernel.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = f_times_mult
expression<<<{"description": "function expression"}>>> = '-f * g'
coupled_variables<<<{"description": "Scalar variables coupled in the parsed expression."}>>> = 'f g'
[../]
[](test/tests/kernels/ode/coupled_ode_td.i)Input 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_tagssystem timeThe tag for the matrices this Kernel should fill
Default:system time
C++ Type:MultiMooseEnum
Options:nontime, system, time
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagstimeThe tag for the vectors this Kernel should fill
Default:time
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
- (test/tests/kernels/ode/coupled_ode_td_auxvar_ic_from_mesh.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADcoupledpressure_twoseg.i)
- (test/tests/kernels/ode/coupled_ode_td.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADfullCP.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADfullCP_exp.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/fullCP.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADpumpCP.i)
- (test/tests/outputs/nemesis/nemesis_scalar.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/coupledpressure_reverse.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADgravCP.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/coupledpressure.i)
- (test/tests/kernels/ode/coupled_ode_td_var_ic_from_mesh.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/coupledpressure_twoseg.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADformsCP.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADcoupledpressure_reverse.i)
- (modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADfrictionCP.i)
(test/tests/kernels/ode/coupled_ode_td.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = 1
nx = 1
[]
[Variables]
[./f]
family = SCALAR
order = FIRST
initial_condition = 1
[../]
[./f_times_mult]
family = SCALAR
order = FIRST
initial_condition = 1
[../]
[]
[ScalarKernels]
[./dT]
type = CoupledODETimeDerivative
variable = f
v = f_times_mult
[../]
[./src]
type = ParsedODEKernel
variable = f
expression = '-1'
[../]
[./f_times_mult_1]
type = ParsedODEKernel
variable = f_times_mult
expression = 'f_times_mult'
[../]
[./f_times_mult_2]
type = ParsedODEKernel
variable = f_times_mult
expression = '-f * g'
coupled_variables = 'f g'
[../]
[]
[AuxVariables]
[./g]
family = SCALAR
order = FIRST
[../]
[]
[Functions]
[./function_g]
type = ParsedFunction
expression = '(1 + t)'
[../]
[]
[AuxScalarKernels]
[./set_g]
type = FunctionScalarAux
function = function_g
variable = g
execute_on = 'linear initial'
[../]
[]
[Executioner]
type = Transient
dt = 1
num_steps = 3
nl_abs_tol = 1e-9
[]
[Outputs]
csv = true
[]
(test/tests/kernels/ode/coupled_ode_td_auxvar_ic_from_mesh.i)
[Mesh]
type = FileMesh
file = 'coupled_ode_td_out.e'
[]
[Variables]
[f]
family = SCALAR
order = FIRST
initial_condition = 1
[]
[f_times_mult]
family = SCALAR
order = FIRST
initial_condition = 1
[]
[]
[ScalarKernels]
[dT]
type = CoupledODETimeDerivative
variable = f
v = f_times_mult
[]
[src]
type = ParsedODEKernel
variable = f
expression = '-1'
[]
[f_times_mult_1]
type = ParsedODEKernel
variable = f_times_mult
expression = 'f_times_mult'
[]
[f_times_mult_2]
type = ParsedODEKernel
variable = f_times_mult
expression = '-f * g'
coupled_variables = 'f g'
[]
[]
[AuxVariables]
[g]
family = SCALAR
order = FIRST
initial_from_file_var = g
initial_from_file_timestep = 'LATEST'
[]
[]
[Functions]
[function_g]
type = ParsedFunction
expression = '(1 + t)'
[]
[]
[AuxScalarKernels]
[set_g]
type = FunctionScalarAux
function = function_g
variable = g
execute_on = 'timestep_end'
[]
[]
[Problem]
# There are initial conditions overwriting the restart on the nonlinear variables
# However this test is targeted at the auxiliary variable restart so it's ok
allow_initial_conditions_with_restart = true
[]
[Executioner]
type = Transient
dt = 1
num_steps = 3
nl_abs_tol = 1e-9
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADcoupledpressure_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 = CoupledPressureIncompressibleMomentumSPScalarKernel
variable = 'dPc'
coupled_mass_flow_rate = 'm1'
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_coupledDT]
type = CoupledODETimeDerivative
variable = 'dPc'
v = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[m1k]
type = ParsedODEKernel
expression = 'm1 - ${min}'
variable = m1
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[dP]
type = ScalarVariable
variable = dPc
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_dP]
type = ParsedPostprocessor
expression = '- ${pump1} - ${pump2}
+ f1 * ${length1} * mdot^2 / 4 / ${R1} / ${rho} / ${area1}^2
+ f2 * ${length2} * mdot^2 / 4 / ${R2} / ${rho} / ${area2}^2
+ ${forms1} * mdot^2 / 2 / ${rho} / ${area1}^2
+ ${forms2} * mdot^2 / 2 / ${rho} / ${area2}^2
+ ${rho} * ${gravity} * ${length1} * sin(${alpha1})
+ ${rho} * ${gravity} * ${length2} * sin(${alpha2})'
pp_names = 'f1 f2 mdot'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_dP - dP)/analytical_dP)'
pp_names = 'analytical_dP dP'
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-12
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(test/tests/kernels/ode/coupled_ode_td.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = 1
nx = 1
[]
[Variables]
[./f]
family = SCALAR
order = FIRST
initial_condition = 1
[../]
[./f_times_mult]
family = SCALAR
order = FIRST
initial_condition = 1
[../]
[]
[ScalarKernels]
[./dT]
type = CoupledODETimeDerivative
variable = f
v = f_times_mult
[../]
[./src]
type = ParsedODEKernel
variable = f
expression = '-1'
[../]
[./f_times_mult_1]
type = ParsedODEKernel
variable = f_times_mult
expression = 'f_times_mult'
[../]
[./f_times_mult_2]
type = ParsedODEKernel
variable = f_times_mult
expression = '-f * g'
coupled_variables = 'f g'
[../]
[]
[AuxVariables]
[./g]
family = SCALAR
order = FIRST
[../]
[]
[Functions]
[./function_g]
type = ParsedFunction
expression = '(1 + t)'
[../]
[]
[AuxScalarKernels]
[./set_g]
type = FunctionScalarAux
function = function_g
variable = g
execute_on = 'linear initial'
[../]
[]
[Executioner]
type = Transient
dt = 1
num_steps = 3
nl_abs_tol = 1e-9
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADfullCP.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 = CoupledPressureIncompressibleMomentumSPScalarKernel
variable = 'dPc'
coupled_mass_flow_rate = 'm1'
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_coupledDT]
type = CoupledODETimeDerivative
variable = 'dPc'
v = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[m1k]
type = ParsedODEKernel
expression = 'm1 - ${min}'
variable = m1
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[dP]
type = ScalarVariable
variable = dPc
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_dP]
type = ParsedPostprocessor
expression = '-${pump} + f * ${length} * mdot^2 / 4 / ${R} / ${rho} / ${area}^2 + ${forms} * mdot^2 / 2 / ${rho} / ${area}^2 + ${rho} * ${gravity} * ${length} * sin(${alpha})'
pp_names = 'f mdot'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_dP - dP)/analytical_dP)'
pp_names = 'analytical_dP dP'
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/ADfullCP_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 = CoupledPressureIncompressibleMomentumSPScalarKernel
variable = 'dPc'
coupled_mass_flow_rate = 'm1'
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_coupledDT]
type = CoupledODETimeDerivative
variable = 'dPc'
v = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[m1k]
type = ParsedODEKernel
expression = 'm1 - ${min}'
variable = m1
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[dP]
type = ScalarVariable
variable = dPc
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_dP]
type = ParsedPostprocessor
expression = '-${pump} + f * ${length} * mdot^2 / 4 / ${R} / ${rho} / ${area}^2 + ${forms} * mdot^2 / 2 / ${rho} / ${area}^2 + ${rho} * ${gravity} * ${length} * sin(${alpha})'
pp_names = 'f mdot'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_dP - dP)/analytical_dP)'
pp_names = 'analytical_dP dP'
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/fullCP.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 = CoupledPressureIncompressibleMomentumSPScalarKernel
variable = 'dPc'
coupled_mass_flow_rate = 'm1'
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_coupledDT]
type = CoupledODETimeDerivative
variable = 'dPc'
v = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[m1k]
type = ParsedODEKernel
expression = 'm1 - ${min}'
variable = m1
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[dP]
type = ScalarVariable
variable = dPc
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_dP]
type = ParsedPostprocessor
expression = '-${pump} + f * ${length} * mdot^2 / 4 / ${R} / ${rho} / ${area}^2 + ${forms} * mdot^2 / 2 / ${rho} / ${area}^2 + ${rho} * ${gravity} * ${length} * sin(${alpha})'
pp_names = 'f mdot'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_dP - dP)/analytical_dP)'
pp_names = 'analytical_dP dP'
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/ADpumpCP.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 = CoupledPressureIncompressibleMomentumSPScalarKernel
variable = 'dPc'
coupled_mass_flow_rate = 'm1'
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_coupledDT]
type = CoupledODETimeDerivative
variable = 'dPc'
v = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[m1k]
type = ParsedODEKernel
expression = 'm1 - ${min}'
variable = m1
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[dP]
type = ScalarVariable
variable = dPc
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_dP]
type = ParsedPostprocessor
expression = '-${pump} + f * ${length} * mdot^2 / 4 / ${R} / ${rho} / ${area}^2 + ${forms} * mdot^2 / 2 / ${rho} / ${area}^2 + ${rho} * ${gravity} * ${length} * sin(${alpha})'
pp_names = 'f mdot'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_dP - dP)/analytical_dP)'
pp_names = 'analytical_dP dP'
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'
[]
[]
(test/tests/outputs/nemesis/nemesis_scalar.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = 1
nx = 4
[]
[Variables]
[./f]
family = SCALAR
order = FIRST
initial_condition = 1
[../]
[./f_times_mult]
family = SCALAR
order = FIRST
initial_condition = 1
[../]
[]
[ScalarKernels]
[./dT]
type = CoupledODETimeDerivative
variable = f
v = f_times_mult
[../]
[./src]
type = ParsedODEKernel
variable = f
expression = '-1'
[../]
[./f_times_mult_1]
type = ParsedODEKernel
variable = f_times_mult
expression = 'f_times_mult'
[../]
[./f_times_mult_2]
type = ParsedODEKernel
variable = f_times_mult
expression = '-f * g'
coupled_variables = 'f g'
[../]
[]
[AuxVariables]
[./g]
family = SCALAR
order = FIRST
[../]
[]
[Functions]
[./function_g]
type = ParsedFunction
expression = '(1 + t)'
[../]
[]
[AuxScalarKernels]
[./set_g]
type = FunctionScalarAux
function = function_g
variable = g
execute_on = 'linear initial'
[../]
[]
[Executioner]
type = Transient
dt = 1
num_steps = 3
nl_abs_tol = 1e-9
[]
[Outputs]
nemesis = true
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/coupledpressure_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 = CoupledPressureIncompressibleMomentumSPScalarKernel
variable = 'dPc'
coupled_mass_flow_rate = 'm1'
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_coupledDT]
type = CoupledODETimeDerivative
variable = 'dPc'
v = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[m1k]
type = ParsedODEKernel
expression = 'm1 - ${min}'
variable = m1
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[dP]
type = ScalarVariable
variable = dPc
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_dP]
type = ParsedPostprocessor
expression = '-${pump} + f * ${length} * mdot * abs(mdot) / 4 / ${R} / ${rho} / ${area}^2 + ${forms} * mdot * abs(mdot) / 2 / ${rho} / ${area}^2 + ${rho} * ${gravity} * ${length} * sin(${alpha})'
pp_names = 'f mdot'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_dP - dP)/analytical_dP)'
pp_names = 'analytical_dP dP'
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/ADgravCP.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 = CoupledPressureIncompressibleMomentumSPScalarKernel
variable = 'dPc'
coupled_mass_flow_rate = 'm1'
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_coupledDT]
type = CoupledODETimeDerivative
variable = 'dPc'
v = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[m1k]
type = ParsedODEKernel
expression = 'm1 - ${min}'
variable = m1
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[dP]
type = ScalarVariable
variable = dPc
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_dP]
type = ParsedPostprocessor
expression = '-${pump} + f * ${length} * mdot^2 / 4 / ${R} / ${rho} / ${area}^2 + ${forms} * mdot^2 / 2 / ${rho} / ${area}^2 + ${rho} * ${gravity} * ${length} * sin(${alpha})'
pp_names = 'f mdot'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_dP - dP)/analytical_dP)'
pp_names = 'analytical_dP dP'
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/coupledpressure.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 = CoupledPressureIncompressibleMomentumSPScalarKernel
variable = 'dPc'
coupled_mass_flow_rate = 'm1'
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_coupledDT]
type = CoupledODETimeDerivative
variable = 'dPc'
v = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[m1k]
type = ParsedODEKernel
expression = 'm1 - ${min}'
variable = m1
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[dP]
type = ScalarVariable
variable = dPc
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_dP]
type = ParsedPostprocessor
expression = '-${pump} + f * ${length} * mdot^2 / 4 / ${R} / ${rho} / ${area}^2 + ${forms} * mdot^2 / 2 / ${rho} / ${area}^2 + ${rho} * ${gravity} * ${length} * sin(${alpha})'
pp_names = 'f mdot'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_dP - dP)/analytical_dP)'
pp_names = 'analytical_dP dP'
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'
[]
[]
(test/tests/kernels/ode/coupled_ode_td_var_ic_from_mesh.i)
[Mesh]
type = FileMesh
file = 'coupled_ode_td_out.e'
[]
[Variables]
[f]
family = SCALAR
order = FIRST
initial_from_file_var = f
initial_from_file_timestep = 'LATEST'
[]
[f_times_mult]
family = SCALAR
order = FIRST
initial_from_file_var = f_times_mult
initial_from_file_timestep = 'LATEST'
[]
[]
[ScalarKernels]
[dT]
type = CoupledODETimeDerivative
variable = f
v = f_times_mult
[]
[src]
type = ParsedODEKernel
variable = f
expression = '-1'
[]
[f_times_mult_1]
type = ParsedODEKernel
variable = f_times_mult
expression = 'f_times_mult'
[]
[f_times_mult_2]
type = ParsedODEKernel
variable = f_times_mult
expression = '-f * g'
coupled_variables = 'f g'
[]
[]
[AuxVariables]
[g]
family = SCALAR
order = FIRST
[]
[]
[Functions]
[function_g]
type = ParsedFunction
expression = '(1 + t)'
[]
[]
[AuxScalarKernels]
[set_g]
type = FunctionScalarAux
function = function_g
variable = g
execute_on = 'linear initial'
[]
[]
[Executioner]
type = Transient
dt = 1
num_steps = 3
nl_abs_tol = 1e-9
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/coupledpressure_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 = CoupledPressureIncompressibleMomentumSPScalarKernel
variable = 'dPc'
coupled_mass_flow_rate = 'm1'
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_coupledDT]
type = CoupledODETimeDerivative
variable = 'dPc'
v = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[m1k]
type = ParsedODEKernel
expression = 'm1 - ${min}'
variable = m1
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[dP]
type = ScalarVariable
variable = dPc
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_dP]
type = ParsedPostprocessor
expression = '- ${pump1} - ${pump2}
+ f1 * ${length1} * mdot^2 / 4 / ${R1} / ${rho} / ${area1}^2
+ f2 * ${length2} * mdot^2 / 4 / ${R2} / ${rho} / ${area2}^2
+ ${forms1} * mdot^2 / 2 / ${rho} / ${area1}^2
+ ${forms2} * mdot^2 / 2 / ${rho} / ${area2}^2
+ ${rho} * ${gravity} * ${length1} * sin(${alpha1})
+ ${rho} * ${gravity} * ${length2} * sin(${alpha2})'
pp_names = 'f1 f2 mdot'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_dP - dP)/analytical_dP)'
pp_names = 'analytical_dP dP'
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/ADformsCP.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 = CoupledPressureIncompressibleMomentumSPScalarKernel
variable = 'dPc'
coupled_mass_flow_rate = 'm1'
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_coupledDT]
type = CoupledODETimeDerivative
variable = 'dPc'
v = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[m1k]
type = ParsedODEKernel
expression = 'm1 - ${min}'
variable = m1
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[dP]
type = ScalarVariable
variable = dPc
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_dP]
type = ParsedPostprocessor
expression = '-${pump} + f * ${length} * mdot^2 / 4 / ${R} / ${rho} / ${area}^2 + ${forms} * mdot^2 / 2 / ${rho} / ${area}^2 + ${rho} * ${gravity} * ${length} * sin(${alpha})'
pp_names = 'f mdot'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_dP - dP)/analytical_dP)'
pp_names = 'analytical_dP dP'
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/ADcoupledpressure_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 = CoupledPressureIncompressibleMomentumSPScalarKernel
variable = 'dPc'
coupled_mass_flow_rate = 'm1'
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_coupledDT]
type = CoupledODETimeDerivative
variable = 'dPc'
v = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[m1k]
type = ParsedODEKernel
expression = 'm1 - ${min}'
variable = m1
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[dP]
type = ScalarVariable
variable = dPc
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_dP]
type = ParsedPostprocessor
expression = '-${pump} + f * ${length} * mdot * abs(mdot) / 4 / ${R} / ${rho} / ${area}^2 + ${forms} * mdot * abs(mdot) / 2 / ${rho} / ${area}^2 + ${rho} * ${gravity} * ${length} * sin(${alpha})'
pp_names = 'f mdot'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_dP - dP)/analytical_dP)'
pp_names = 'analytical_dP dP'
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-12
l_tol = 1e-07
[]
[Outputs]
perf_graph = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/thermal_hydraulics/test/tests/scalarkernels/IncompressibleVerification/ADfrictionCP.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 = CoupledPressureIncompressibleMomentumSPScalarKernel
variable = 'dPc'
coupled_mass_flow_rate = 'm1'
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_coupledDT]
type = CoupledODETimeDerivative
variable = 'dPc'
v = 'm1'
[]
[temp]
type = ParsedODEKernel
expression = 'T1 - ${Tin}'
variable = T1
[]
[m1k]
type = ParsedODEKernel
expression = 'm1 - ${min}'
variable = m1
[]
[]
[Postprocessors]
[mdot]
type = ScalarVariable
variable = m1
execute_on = 'TIMESTEP_END'
[]
[dP]
type = ScalarVariable
variable = dPc
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_dP]
type = ParsedPostprocessor
expression = '-${pump} + f * ${length} * mdot^2 / 4 / ${R} / ${rho} / ${area}^2 + ${forms} * mdot^2 / 2 / ${rho} / ${area}^2 + ${rho} * ${gravity} * ${length} * sin(${alpha})'
pp_names = 'f mdot'
execute_on = 'TIMESTEP_END'
[]
[relative_error]
type = ParsedPostprocessor
expression = 'abs((analytical_dP - dP)/analytical_dP)'
pp_names = 'analytical_dP dP'
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'
[]
[]