CaloricallyImperfectGas

Fluid properties for an ideal gas with imperfect caloric behavior.

This class implements fluid properties for a gas that behaves like an ideal gas except that the specific heat capacities are a function of temperature (as opposed to constants as for the ideal gas).

The relationship between pressure, density, and temperature is identical to an ideal gas:

pv=RsT, pv = R_s T,

where pp is pressure, vv is specific volume, RsR_s is the specific gas constant, and TT is temperature.

The internal energy ee is a user-provided function of temperature:

e=e(T). e = e(T).

The function e(T)e(T) is provided via parameter "e". The time argument is interpreted as temperature.

The enthalpy is computed by:

h=e(T)+RsT. h = e(T) + R_s T.

The specific heat capacities at constant volume and pressure cvc_v and cpc_p are computed by:

cv=dedTcp=dedT+Rs.\begin{aligned} c_v &= \frac{de}{dT} \\ c_p &= \frac{de}{dT} + R_s. \end{aligned}
warningwarning

The specific heat capacities are computed from e(T)e(T) using the timeDerivative method of the Function class. The type of function that is used for e(T)e(T) must implement the timeDerivative method.

The inverse functions T(e)T(e) and T(h)T(h) are obtained as follows:

  1. Ensure that within the acceptable temperature range (parameters min_temperature and max_temperature) cv>0c_v > 0.

  2. Compute the minimum and maximum values of ee and hh.

emin=e(Tmin)emax=e(Tmax)hmin=h(Tmin)hmax=h(Tmax)\begin{aligned} e_{min} &= e(T_{min}) \\ e_{max} &= e(T_{max}) \\ h_{min} &= h(T_{min}) \\ h_{max} &= h(T_{max}) \\ \end{aligned}
  1. Sample

    ej=emin+jemaxeminN,j=0,..,N.e_j = e_{min} + j \frac{e_{max}-e_{min}}{N},\qquad j=0,..,N.

    and for each eje_j solve

    eje(Tj)=0,e_j - e(T_j)= 0,

    for TjT_j. Create tabulation {ej,Tj}\{e_j, T_j\}. Create a similar tabulation for enthalpy.

  2. Evaluating T(e)T(e) uses linear interpolation in {ej,Tj}\{e_j, T_j\}.

Evaluating Entropy

From the first and second law of thermodynamics is follows that:

dq=de+pdvds=dq/T,\begin{aligned} dq &= de + pdv \\ ds &= dq/T, \end{aligned}

where dqdq is an infinitesimal amount of heat. Solving for dsds and using the ideal gas law leads to:

ds=deT+Rsdvv. ds = \frac{de}{T} + R_s \frac{dv}{v}.

Integrating this equation leads to an expression for the entropy:

s(e,v)s(e0,v0)=e0edeT+Rslogvv0, s(e, v) - s(e_0, v_0) = \int\limits_{e_0}^e \frac{de'}{T'} + R_s \log \frac{v}{v_0},

where the prime indicates that these variables are dummy variables of integration. We are free to select a zero-point for entropy and we select s(e0,v0)=0s(e_0, v_0) = 0. We also select v0=1v_0 = 1 and e0=e(Tmin)e_0 = e(T_{min}). Then we define:

Z(T)=e0e(T)deT=TminTcv(T)TdT. Z(T) = \int\limits_{e_0}^{e(T)} \frac{de'}{T'} = \int\limits_{T_{min}}^{T} \frac{c_v(T')}{T'} dT'.

Entropy is computed from the expression:

s(e,v)=Z(T(e))+Rslogv, s(e, v) = Z(T(e)) + R_s \log v,

where Z(T)Z(T) is computed using a trapezoidal rule and tabulated between TminT_{min} and TmaxT_{max}. It is linearly interpolated.

The derivatives of entropy with respect to TT, ee, hh, vv are given by:

(se)v=1T(e)(sv)e=Rsv(sp)T=Rsp(sT)p=cp(T)T(sp)h=Rsp(sh)p=1T.\begin{aligned} \left(\frac{\partial s}{\partial e}\right)_v &= \frac{1}{T(e)} \\ \left(\frac{\partial s}{\partial v}\right)_e &= \frac{R_s}{v} \\ \left(\frac{\partial s}{\partial p}\right)_T &= -\frac{R_s}{p} \\ \left(\frac{\partial s}{\partial T}\right)_p &= \frac{c_p(T)}{T} \\ \left(\frac{\partial s}{\partial p}\right)_h &= -\frac{R_s}{p} \\ \left(\frac{\partial s}{\partial h}\right)_p &= \frac{1}{T}. \end{aligned}

These derivatives are implemented in the 5 argument versions of the s_from_x_y functions.

Input Parameters

  • eSpecific internal energy as a function of temperature [J/kg]

    C++ Type:FunctionName

    Unit:(no unit assumed)

    Controllable:No

    Description:Specific internal energy as a function of temperature [J/kg]

  • kThermal conductivity, [W/(m-K)]

    C++ Type:FunctionName

    Unit:(no unit assumed)

    Controllable:No

    Description:Thermal conductivity, [W/(m-K)]

  • max_temperatureLargest temperature for lookup tables [K]

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Largest temperature for lookup tables [K]

  • min_temperatureSmallest temperature for lookup tables [K]

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Smallest temperature for lookup tables [K]

  • molar_massConstant molar mass of the fluid [kg/mol]

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Constant molar mass of the fluid [kg/mol]

  • muDynamic viscosity, [Pa-s]

    C++ Type:FunctionName

    Unit:(no unit assumed)

    Controllable:No

    Description:Dynamic viscosity, [Pa-s]

Required Parameters

  • T_c0Critical temperature, [K]

    Default:0

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Critical temperature, [K]

  • e_c0Specific internal energy at the critical point, [J/kg]

    Default:0

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Specific internal energy at the critical point, [J/kg]

  • emit_on_nannoneWhether to raise a warning, an exception (usually triggering a retry with a smaller time step) or an error (ending the simulation)

    Default:none

    C++ Type:MooseEnum

    Unit:(no unit assumed)

    Options:none, warning, exception, error

    Controllable:No

    Description:Whether to raise a warning, an exception (usually triggering a retry with a smaller time step) or an error (ending the simulation)

  • execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.

    Default:TIMESTEP_END

    C++ Type:ExecFlagEnum

    Unit:(no unit assumed)

    Options:NONE, INITIAL, LINEAR, NONLINEAR_CONVERGENCE, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM

    Controllable:No

    Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.

  • out_of_bound_errorTrueError if out of bounds

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Error if out of bounds

  • prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

    C++ Type:MaterialPropertyName

    Unit:(no unit assumed)

    Controllable:No

    Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

  • rho_c0Critical density, [kg/m3]

    Default:0

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Critical density, [kg/m3]

  • temperature_resolution1Step size in temperature for creating the inverse lookup T(e)

    Default:1

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Step size in temperature for creating the inverse lookup T(e)

  • use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

Optional Parameters

  • T_initial_guess400Temperature initial guess for Newton Method variable set conversion

    Default:400

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Temperature initial guess for Newton Method variable set conversion

  • p_initial_guess200000Pressure initial guess for Newton Method variable set conversion

    Default:200000

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Pressure initial guess for Newton Method variable set conversion

  • tolerance1e-08Tolerance for 2D Newton variable set conversion

    Default:1e-08

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Tolerance for 2D Newton variable set conversion

Variable Set Conversions Newton Solve Parameters

  • allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

  • allow_imperfect_jacobiansFalsetrue to allow unimplemented property derivative terms to be set to zero for the AD API

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:true to allow unimplemented property derivative terms to be set to zero for the AD API

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    Controllable:Yes

    Description:Set the enabled status of the MooseObject.

  • execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

    Default:0

    C++ Type:int

    Unit:(no unit assumed)

    Controllable:No

    Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

  • force_postauxFalseForces the UserObject to be executed in POSTAUX

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Forces the UserObject to be executed in POSTAUX

  • force_preauxFalseForces the UserObject to be executed in PREAUX

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Forces the UserObject to be executed in PREAUX

  • force_preicFalseForces the UserObject to be executed in PREIC during initial setup

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Forces the UserObject to be executed in PREIC during initial setup

  • fp_typesingle-phase-fpType of the fluid property object

    Default:single-phase-fp

    C++ Type:FPType

    Unit:(no unit assumed)

    Controllable:No

    Description:Type of the fluid property object

  • 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

    Unit:(no unit assumed)

    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

References

No citations exist within this document.