Skip to content
Permalink
Browse files

Merge pull request #12971 from cpgr/fpideal

Consolidate ideal gas classes in fluid properties module
  • Loading branch information...
andrsd committed Feb 27, 2019
2 parents ee493f6 + eaddf60 commit 54457575a716a7e87237e88ed8bf1258f3758c6a
@@ -22,6 +22,7 @@ InputParameters validParams<IdealGasFluidProperties>();

/**
* Ideal gas fluid properties
* Default parameters are for air at atmospheric pressure and temperature
*/
class IdealGasFluidProperties : public SinglePhaseFluidProperties
{
@@ -74,7 +75,6 @@ class IdealGasFluidProperties : public SinglePhaseFluidProperties
virtual void p_from_h_s(Real h, Real s, Real & p, Real & dp_dh, Real & dp_ds) const override;
virtual Real g_from_v_e(Real v, Real e) const override;
virtual Real T_from_p_h(Real p, Real h) const override;
virtual Real molarMass() const override;
virtual Real cv_from_p_T(Real p, Real T) const override;
virtual Real cp_from_p_T(Real p, Real T) const override;
virtual void cp_from_p_T(Real p, Real T, Real & cp, Real & dcp_dp, Real & dcp_dT) const override;
@@ -83,22 +83,37 @@ class IdealGasFluidProperties : public SinglePhaseFluidProperties
virtual Real k_from_p_T(Real pressure, Real temperature) const override;
virtual void
k_from_p_T(Real pressure, Real temperature, Real & k, Real & dk_dp, Real & dk_dT) const override;
virtual std::string fluidName() const override;
virtual Real molarMass() const override;
virtual Real gamma_from_v_e(Real v, Real e) const override;
virtual Real gamma_from_p_T(Real p, Real T) const override;
virtual Real c_from_p_T(Real p, Real T) const override;

virtual Real henryConstant(Real temperature) const override;
virtual void henryConstant(Real temperature, Real & Kh, Real & dKh_dT) const override;

virtual Real gamma() const;
virtual Real cv() const;
virtual Real cp() const;
// Methods used by Navier-Stokes module
virtual Real gamma() const { return _gamma; };
virtual Real cv() const { return _cv; };
virtual Real cp() const { return _cp; };

protected:
/// Adiabatic index (ratio of specific heats cp/cv)
Real _gamma;
Real _R;
/// Specific gas constant (R / molar mass)
Real _R_specific;
/// Specific heat at constant volume
Real _cv;
/// Specific heat at constant pressure
Real _cp;

Real _mu;
Real _k;

/// Universal gas constant [J/K.mol]
constexpr static Real R_universal = 8.3144598;
/// Dynamic viscosity
const Real _mu;
/// Thermal conductivity
const Real _k;
/// molar mass
Real _molar_mass;
/// Henry constant
const Real _henry_constant;
};

#pragma GCC diagnostic pop
@@ -10,7 +10,7 @@
#ifndef IDEALGASFLUIDPROPERTIESPT_H
#define IDEALGASFLUIDPROPERTIESPT_H

#include "SinglePhaseFluidProperties.h"
#include "IdealGasFluidProperties.h"

class IdealGasFluidPropertiesPT;

@@ -24,92 +24,10 @@ InputParameters validParams<IdealGasFluidPropertiesPT>();
* Ideal gas fluid properties for (pressure, temperature) variables.
* Default parameters are for air at atmospheric pressure and temperature.
*/
class IdealGasFluidPropertiesPT : public SinglePhaseFluidProperties
class IdealGasFluidPropertiesPT : public IdealGasFluidProperties
{
public:
IdealGasFluidPropertiesPT(const InputParameters & parameters);
virtual ~IdealGasFluidPropertiesPT();

virtual std::string fluidName() const override;

virtual Real molarMass() const override;

virtual Real cp_from_p_T(Real pressure, Real temperature) const override;

using SinglePhaseFluidProperties::cp_from_p_T;

virtual Real cv_from_p_T(Real pressure, Real temperature) const override;

virtual Real c_from_p_T(Real pressure, Real temperature) const override;

virtual Real k_from_p_T(Real pressure, Real temperature) const override;

virtual void
k_from_p_T(Real pressure, Real temperature, Real & k, Real & dk_dp, Real & dk_dT) const override;

virtual Real s_from_p_T(Real pressure, Real temperature) const override;
virtual void s_from_p_T(Real p, Real T, Real & s, Real & ds_dp, Real & ds_dT) const override;

virtual Real rho_from_p_T(Real pressure, Real temperature) const override;

virtual void rho_from_p_T(
Real pressure, Real temperature, Real & rho, Real & drho_dp, Real & drho_dT) const override;

virtual Real e_from_p_T(Real pressure, Real temperature) const override;

virtual void
e_from_p_T(Real pressure, Real temperature, Real & e, Real & de_dp, Real & de_dT) const override;

virtual void rho_e_dpT(Real pressure,
Real temperature,
Real & rho,
Real & drho_dp,
Real & drho_dT,
Real & e,
Real & de_dp,
Real & de_dT) const override;

virtual Real mu_from_p_T(Real pressure, Real temperature) const override;

virtual void mu_from_p_T(
Real pressure, Real temperature, Real & mu, Real & dmu_dp, Real & dmu_dT) const override;

virtual void
rho_mu_from_p_T(Real pressure, Real temperature, Real & rho, Real & mu) const override;

virtual void rho_mu_from_p_T(Real pressure,
Real temperature,
Real & rho,
Real & drho_dp,
Real & drho_dT,
Real & mu,
Real & dmu_dp,
Real & dmu_dT) const override;

virtual Real h_from_p_T(Real p, Real T) const override;

virtual void
h_from_p_T(Real pressure, Real temperature, Real & h, Real & dh_dp, Real & dh_dT) const override;

virtual Real henryConstant(Real temperature) const override;

virtual void henryConstant(Real temperature, Real & Kh, Real & dKh_dT) const override;

protected:
/// molar mass
const Real _molar_mass;
/// specific heat at constant volume
const Real _cv;
/// specific heat at constant pressure
const Real _cp;
/// thermal conductivity
const Real _thermal_conductivity;
/// specific entropy
const Real _specific_entropy;
/// viscosity
const Real _viscosity;
/// Henry constant
const Real _henry_constant;
};

#pragma GCC diagnostic pop
@@ -377,6 +377,14 @@ class SinglePhaseFluidProperties : public FluidProperties

virtual Real c(Real pressure, Real temperature) const;

/**
* Adiabatic index - ratio of specific heats
* @param v specific volume
* @param e specific internal energy
* @return gamma (-)
*/
virtual Real gamma_from_v_e(Real v, Real e) const;

/**
* Adiabatic index - ratio of specific heats
* @param pressure fluid pressure (Pa)
Oops, something went wrong.

0 comments on commit 5445757

Please sign in to comment.
You can’t perform that action at this time.