- connectionsJunction connections
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:Junction connections
- open_area_fractionFraction of flow area that is open [-]
C++ Type:Real
Unit:(no unit assumed)
Controllable:Yes
Description:Fraction of flow area that is open [-]
GateValve1Phase
This component implements a gate valve, which is controlled via a function that represents the fraction of the possible flow area that is actually open to flow, given the status of the valve.
Input 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:No
Description:Set the enabled status of the MooseObject.
Advanced Parameters
Input Files
(modules/thermal_hydraulics/test/tests/components/gate_valve_1phase/variable_area_conservation.i)
# Tests that mass is conserved across a GateValve1Phase when the area of the
# connected flow channels varies within the elements touching the valve.
# Both channels taper linearly to A_j at the valve, so the element-average
# area of each connected element differs from the area at the connection.
A1 = 0.0567
A2 = 0.02222
A_j = 0.03192
m_dot = 20
[GlobalParams]
initial_T = 393.15
initial_p = 1.318964e+07
initial_vel = 0.5
f = 0
fp = fp
closures = simple_closures
scaling_factor_1phase = '1 1 1e-5'
[]
[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[A1_fn]
type = PiecewiseLinear
axis = x
x = '0 0.5 1'
y = '${A1} ${A1} ${A_j}'
[]
[A2_fn]
type = PiecewiseLinear
axis = x
x = '1 1.5 2'
y = '${A_j} ${A2} ${A2}'
[]
[]
[Components]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = ${m_dot}
T = 393.15
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 20
A = A1_fn
[]
[valve]
type = GateValve1Phase
connections = 'pipe1:out pipe2:in'
open_area_fraction = 1
[]
[pipe2]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
length = 1
n_elems = 20
A = A2_fn
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = 1.318964e+07
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'implicit-euler'
dt = 0.2
end_time = 40
solve_type = NEWTON
line_search = basic
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
nl_max_its = 20
abort_on_solve_fail = true
[]
[Postprocessors]
[m_dot_in]
type = ADFlowBoundaryFlux1Phase
boundary = 'inlet'
equation = mass
execute_on = 'FINAL'
[]
[m_dot_out]
type = ADFlowBoundaryFlux1Phase
boundary = 'outlet'
equation = mass
execute_on = 'FINAL'
[]
# Relative difference from the inlet mass flow rate; zero when mass is conserved
[m_dot_out_diff]
type = ParsedPostprocessor
expression = '(m_dot_out - m_dot_in) / m_dot_in'
pp_names = 'm_dot_out m_dot_in'
execute_on = 'FINAL'
[]
[]
[Outputs]
[out]
type = CSV
execute_on = 'FINAL'
show = 'm_dot_out_diff'
[]
[]
(modules/thermal_hydraulics/test/tests/components/gate_valve_1phase/gate_valve_1phase.i)
# This input file is used to test the gate valve component.
# This problem consists of a T junction of 3 pipes. The inlet pipe is one of the
# 2 pipes of the "top" of the T. The other 2 pipes each have a gate valve.
# Initially, one of the 2 outlet pipes has an open valve and the other has a
# closed valve. Later in the transient, the valves gradually open/close to switch
# the outlet flow direction.
p = 1.0e5
T = 300.0
rho = 1.161430436 # @ 1e5 Pa, 300 K
D = 0.1
A = ${fparse pi * D^2 / 4.0}
V_junction = ${fparse pi * D^3 / 4.0}
vel_in = 2.0
m_dot = ${fparse rho * vel_in * A}
t_begin = 0.3
delta_t_open = 0.1
[GlobalParams]
gravity_vector = '0 0 0'
closures = simple_closures
fp = fp
f = 0.0
initial_T = ${T}
initial_p = ${p}
initial_vel = 0
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02897
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[pipe3_open_fn]
type = TimeRampFunction
initial_value = 1
final_value = 0
initial_time = ${t_begin}
ramp_duration = ${delta_t_open}
[]
[pipe2_open_fn]
type = ParsedFunction
expression = '1 - pipe3_phi'
symbol_names = 'pipe3_phi'
symbol_values = 'pipe3_open_fn'
[]
[]
[Components]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'pipe1:in'
m_dot = ${m_dot}
T = ${T}
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1.0
n_elems = 50
A = ${A}
[]
[volume_junction]
type = VolumeJunction1Phase
position = '1 0 0'
connections = 'pipe1:out pipe2A:in pipe3A:in'
volume = ${V_junction}
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
[]
[pipe2A]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '0 1 0'
length = 0.5
n_elems = 25
A = ${A}
[]
[pipe2_valve]
type = GateValve1Phase
connections = 'pipe2A:out pipe2B:in'
open_area_fraction = 0 # (controlled via 'pipe2_valve_control')
[]
[pipe2B]
type = FlowChannel1Phase
position = '1 0.5 0'
orientation = '0 1 0'
length = 0.5
n_elems = 25
A = ${A}
[]
[pipe2_outlet]
type = Outlet1Phase
input = 'pipe2B:out'
p = ${p}
[]
[pipe3A]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 25
A = ${A}
[]
[pipe3_valve]
type = GateValve1Phase
connections = 'pipe3A:out pipe3B:in'
open_area_fraction = 0 # (controlled via 'pipe3_valve_control')
[]
[pipe3B]
type = FlowChannel1Phase
position = '1.5 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 25
A = ${A}
[]
[pipe3_outlet]
type = Outlet1Phase
input = 'pipe3B:out'
p = ${p}
[]
[]
[ChainControls]
[pipe2_valve_control_fn]
type = GetFunctionValueChainControl
execute_on = 'INITIAL TIMESTEP_BEGIN'
function = pipe2_open_fn
[]
[pipe2_valve_control]
type = SetRealValueChainControl
execute_on = 'INITIAL TIMESTEP_BEGIN'
parameter = component::pipe2_valve/open_area_fraction
value = pipe2_valve_control_fn:value
[]
[pipe3_valve_control_fn]
type = GetFunctionValueChainControl
execute_on = 'INITIAL TIMESTEP_BEGIN'
function = pipe3_open_fn
[]
[pipe3_valve_control]
type = SetRealValueChainControl
execute_on = 'INITIAL TIMESTEP_BEGIN'
parameter = component::pipe3_valve/open_area_fraction
value = pipe3_valve_control_fn:value
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 20
l_tol = 1e-4
start_time = 0.0
end_time = 1.0
dt = 0.01
abort_on_solve_fail = true
[]
[Outputs]
exodus = true
show = 'p T vel'
velocity_as_vector = false
print_linear_residuals = false
[console]
type = Console
max_rows = 1
[]
[]