Modelica.Fluid.Valves.BaseClasses

Base classes used in the Valves package (only of interest to build new component models)

Information

Extends from Modelica.Fluid.Icons.BaseClassLibrary (Icon for library).

Package Content

NameDescription
Modelica.Fluid.Valves.BaseClasses.PartialValve PartialValve Base model for valves
Modelica.Fluid.Valves.BaseClasses.ValveCharacteristics ValveCharacteristics Functions for valve characteristics


Modelica.Fluid.Valves.BaseClasses.PartialValve Modelica.Fluid.Valves.BaseClasses.PartialValve

Base model for valves

Modelica.Fluid.Valves.BaseClasses.PartialValve

Information


This is the base model for the ValveIncompressible, ValveVaporizing, and ValveCompressible valve models. The model is based on the IEC 534 / ISA S.75 standards for valve sizing.

The model optionally supports reverse flow conditions (assuming symmetrical behaviour) or check valve operation, and has been suitably regularized, compared to the equations in the standard, in order to avoid numerical singularities around zero pressure drop operating conditions.

The model assumes adiabatic operation (no heat losses to the ambient); changes in kinetic energy from inlet to outlet are neglected in the energy balance.

Modelling options

The following options are available to specify the valve flow coefficient in fully open conditions:

The nominal pressure drop dp_nominal must always be specified; to avoid numerical singularities, the flow characteristic is modified for pressure drops less than b*dp_nominal (the default value is 1% of the nominal pressure drop). Increase this parameter if numerical problems occur in valves with very low pressure drops.

If checkValve is true, then the flow is stopped when the outlet pressure is higher than the inlet pressure; otherwise, reverse flow takes place. Use this option only when neede, as it increases the numerical complexity of the problem.

The valve opening characteristic valveCharacteristic, linear by default, can be replaced by any user-defined function. Quadratic and equal percentage with customizable rangeability are already provided by the library.

The treatment of parameters Kv and Cv is explained in detail in the Users Guide.

Extends from Modelica.Fluid.Interfaces.PartialTwoPortTransport (Partial element transporting fluid between two ports without storage of mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Flow Coefficient
CvTypesCvDataCvTypes.OpPointSelection of flow coefficient
AreaAv0Av (metric) flow coefficient [m2]
RealKv0Kv (metric) flow coefficient [m3/h]
RealCv0Cv (US) flow coefficient [USG/min]
Nominal operating point
Pressuredp_nominal Nominal pressure drop [Pa]
MassFlowRatem_flow_nominal Nominal mass flowrate [kg/s]
Densityrho_nominalMedium.density_pTX(Medium.p_...Nominal inlet density [kg/m3]
Realopening_nominal1Nominal opening
Assumptions
BooleanallowFlowReversalsystem.allowFlowReversal= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
BooleancheckValvefalseReverse flow stopped
Advanced
AbsolutePressuredp_startdp_nominalGuess value of dp = port_a.p - port_b.p [Pa]
MassFlowRatem_flow_startm_flow_nominalGuess value of m_flow = port_a.m_flow [kg/s]
MassFlowRatem_flow_smallsystem.m_flow_smallSmall mass flow rate for regularization of zero flow [kg/s]
Pressuredp_smallsystem.dp_smallRegularisation of zero flow [Pa]
Diagnostics
Booleanshow_Ttrue= true, if temperatures at port_a and port_b are computed
Booleanshow_V_flowtrue= true, if volume flow rate at inflowing port is computed

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
input RealInputopeningValve position in the range 0-1

Modelica definition

partial model PartialValve "Base model for valves"

  import Modelica.Fluid.Types.CvTypes;
  extends Modelica.Fluid.Interfaces.PartialTwoPortTransport(
    dp_start = dp_nominal,
    m_flow_start = m_flow_nominal,
    m_flow_small = system.m_flow_small);

  parameter CvTypes CvData=CvTypes.OpPoint "Selection of flow coefficient";
  parameter SI.Area Av(
    fixed=if CvData == CvTypes.Av then true else false,
    start=m_flow_nominal/(sqrt(rho_nominal*dp_nominal))*valveCharacteristic(
        opening_nominal)) = 0 "Av (metric) flow coefficient";
  parameter Real Kv = 0 "Kv (metric) flow coefficient [m3/h]";
  parameter Real Cv = 0 "Cv (US) flow coefficient [USG/min]";
  parameter SI.Pressure dp_nominal "Nominal pressure drop";
  parameter Medium.MassFlowRate m_flow_nominal "Nominal mass flowrate";
  parameter Medium.Density rho_nominal=Medium.density_pTX(Medium.p_default, Medium.T_default, Medium.X_default) 
    "Nominal inlet density";
  parameter Real opening_nominal=1 "Nominal opening";
  parameter Boolean checkValve=false "Reverse flow stopped";

  replaceable function valveCharacteristic = 
      Modelica.Fluid.Valves.BaseClasses.ValveCharacteristics.linear 
    constrainedby 
    Modelica.Fluid.Valves.BaseClasses.ValveCharacteristics.baseFun 
    "Inherent flow characteristic";

  parameter SI.Pressure dp_small=system.dp_small "Regularisation of zero flow";

  constant SI.Area Kv2Av = 27.7e-6 "Conversion factor";
  constant SI.Area Cv2Av = 24.0e-6 "Conversion factor";

  Modelica.Blocks.Interfaces.RealInput opening(min=0, max=1) 
    "Valve position in the range 0-1";

initial equation 
  if CvData == CvTypes.Kv then
    Av = Kv*Kv2Av "Unit conversion";
  elseif CvData == CvTypes.Cv then
    Av = Cv*Cv2Av "Unit conversion";
  end if;

equation 
  // Isenthalpic state transformation (no storage and no loss of energy)
  port_a.h_outflow = inStream(port_b.h_outflow);
  port_b.h_outflow = inStream(port_a.h_outflow);

end PartialValve;

HTML-documentation generated by Dymola Sun Jan 17 21:12:16 2010.