Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #pragma once 11 : 12 : #include "TwoPhaseFluidProperties.h" 13 : #include "LinearInterpolation.h" 14 : #include "NaNInterface.h" 15 : 16 : class StiffenedGasFluidProperties; 17 : 18 : #pragma GCC diagnostic push 19 : #pragma GCC diagnostic ignored "-Woverloaded-virtual" 20 : 21 : /** 22 : * Two-phase stiffened gas fluid properties 23 : */ 24 : class StiffenedGasTwoPhaseFluidProperties : public TwoPhaseFluidProperties, public NaNInterface 25 : { 26 : public: 27 : StiffenedGasTwoPhaseFluidProperties(const InputParameters & parameters); 28 : 29 : virtual Real p_critical() const override; 30 : virtual Real T_triple() const override; 31 : virtual Real L_fusion() const override; 32 : virtual Real T_sat(Real pressure) const override; 33 : virtual Real p_sat(Real temperature) const override; 34 : virtual Real dT_sat_dp(Real pressure) const override; 35 : virtual Real sigma_from_T(Real T) const override; 36 : virtual Real dsigma_dT_from_T(Real T) const override; 37 : 38 0 : virtual bool supportsPhaseChange() const override { return true; } 39 : 40 : protected: 41 : /** 42 : * Computes saturation pressure value using Newton solve 43 : * 44 : * The process for determining the saturation pressure is given in the following reference: 45 : * 46 : * Ray A. Berry, Richard Saurel, Olivier LeMetayer 47 : * The discrete equation method (DEM) for fully compressible, two-phase flow 48 : * in ducts of spatially varying cross-section 49 : * Nuclear Engineering and Design 240 (2010) p. 3797-3818 50 : * 51 : * The nonlinear equation to be solved is given by Equation (38) of this 52 : * reference; it is obtained by reasoning that at thermodynamic equilibrium, 53 : * the Gibbs free enthalpy of the phases must be equal at the interface. 54 : * 55 : * @param[in] T temperature at which saturation pressure is to be computed 56 : */ 57 : Real compute_p_sat(const Real & T) const; 58 : 59 : // liquid SGEOS parameters 60 : const Real _gamma_liquid; 61 : const Real _cv_liquid; 62 : const Real _cp_liquid; 63 : const Real _q_liquid; 64 : const Real _p_inf_liquid; 65 : const Real _q_prime_liquid; 66 : 67 : // vapor SGEOS parameters 68 : const Real _gamma_vapor; 69 : const Real _cv_vapor; 70 : const Real _cp_vapor; 71 : const Real _q_vapor; 72 : const Real _p_inf_vapor; 73 : const Real _q_prime_vapor; 74 : 75 : /// critical temperature 76 : const Real & _T_c; 77 : /// critical pressure 78 : const Real & _p_c; 79 : /// Triple-point temperature 80 : const Real & _T_triple; 81 : /// Latent heat of fusion 82 : const Real & _L_fusion; 83 : 84 : /// 'A' constant used in surface tension correlation 85 : const Real & _sigma_A; 86 : /// 'B' constant used in surface tension correlation 87 : const Real & _sigma_B; 88 : /// 'C' constant used in surface tension correlation 89 : const Real & _sigma_C; 90 : 91 : /// Minimum temperature value in saturation curve 92 : const Real & _T_sat_min; 93 : /// Maximum temperature value in saturation curve 94 : const Real & _T_sat_max; 95 : /// Initial guess for saturation pressure Newton solve 96 : const Real & _p_sat_guess; 97 : /// Number of samples to take in saturation curve 98 : const unsigned int & _n_sat_samples; 99 : /// Temperature increments on saturation curve 100 : const Real _dT_sat; 101 : 102 : // coefficients for saturation pressure Newton solve 103 : const Real _A; 104 : const Real _B; 105 : const Real _C; 106 : const Real _D; 107 : 108 : /// Newton solve tolerance 109 : const Real _newton_tol; 110 : /// Newton max number of iterations 111 : const unsigned int _newton_max_iter; 112 : 113 : // These two vectors store saturation line p(T) information by only calculating 114 : // once in constructor and then use interpolation to quickly calculate the value 115 : std::vector<Real> _T_vec; 116 : std::vector<Real> _p_sat_vec; 117 : 118 : LinearInterpolation _ipol_temp; 119 : LinearInterpolation _ipol_pressure; 120 : 121 : public: 122 : static InputParameters validParams(); 123 : }; 124 : 125 : #pragma GCC diagnostic pop