LCOV - code coverage report
Current view: top level - src/Model/Gas - Gas.cpp (source / functions) Coverage Total Hit
Test: coverage_merged.info Lines: 60.0 % 30 18
Test Date: 2026-03-09 13:26:47 Functions: 60.0 % 10 6

            Line data    Source code
       1              : #include <vector>
       2              : #include <cmath>
       3              : #include <memory>
       4              : #include "Util/Util.H"
       5              : #include "Set/Base.H"
       6              : #include "Set/Set.H"
       7              : #include "Model/Gas/Gas.H"
       8              : #include "Model/Gas/Thermo/Thermo.H"
       9              : #include "Model/Gas/Transport/Transport.H"
      10              : #include "Model/Gas/EOS/EOS.H"
      11              : 
      12              : namespace Model {
      13              : namespace Gas {
      14              : 
      15              : // Methods that need to be defined by inherited class
      16              : 
      17              : // Thermodynamic quantities
      18    463376096 : double Gas::cp_mol(double T, Set::Patch<const Set::Scalar>& X, int i, int j, int k) const {
      19              :     // Specific heat (constant pressure), J/(kmol-K)
      20    463376096 :     if (!thermo) Util::Abort(INFO, "[Gas::cp_mol] No Thermo model attached.");
      21    463376096 :     return thermo->cp_mol(T, X, i , j, k);
      22              : }
      23            0 : double Gas::enthalpy_mol(double T, Set::Patch<const Set::Scalar>& X, int i, int j, int k) const {
      24              :     // Specific enthalpy, J/kmol)
      25            0 :     if (!thermo) Util::Abort(INFO, "[Gas::enthalpy_mol] No Thermo model attached.");
      26            0 :     return thermo->enthalpy_mol(T, X, i , j, k);
      27              : }
      28            0 : double Gas::entropy_mol(double T, Set::Patch<const Set::Scalar>& X, int i, int j, int k) const {
      29              :     // specific entropy, J/(kmol-K)
      30            0 :     if (!thermo) Util::Abort(INFO, "[Gas::entropy_mol] No Thermo model attached.");
      31            0 :     return thermo->entropy_mol(T, X, i , j, k);
      32              : }
      33              : 
      34              : // Transport quantities
      35     13235200 : double Gas::dynamic_viscosity(double T, Set::Patch<const Set::Scalar>& X, int i, int j, int k) const {
      36              :     // Dynamic viscosity, Pa-s
      37     13235200 :     if (!transport) Util::Abort(INFO, "[Gas::dynamic_viscosity] No Transport model attached.");
      38     13235200 :     return transport->dynamic_viscosity(T, X, i , j, k);
      39              : }
      40            0 : double Gas::thermal_conductivity(double T, Set::Patch<const Set::Scalar>& X, int i, int j, int k) const {
      41              :     // Thermal conductivity coefficient, W/(m-K)
      42            0 :     if (!transport) Util::Abort(INFO, "[Gas::thermal_conductivity] No Transport model attached.");
      43            0 :     return transport->thermal_conductivity(T, X, i , j, k);
      44              : }
      45            0 : void Gas::diffusion_coeffs(Set::Patch<Set::Scalar>& DKM, double T, double P, Set::Patch<const Set::Scalar>& X, int i, int j, int k) {
      46              :     // Species diffusion coefficients, m^2/s
      47            0 :     if (!transport) Util::Abort(INFO, "[Gas::diffusion_coeffs] No Transport model attached.");
      48            0 :     return transport->diffusion_coeffs(DKM, T, P, X, i , j, k);
      49              : }
      50              : 
      51              : // EOS
      52    125784200 : double Gas::ComputeT(
      53              :         double density, double momentumx, double momentumy, double E, double Tguess,
      54              :         Set::Patch<const Set::Scalar>& X, int i, int j, int k, double rtol) const {
      55              :     // Temperature, K
      56    125784200 :     if (!eos) Util::Abort(INFO, "[Gas::ComputeT] No EOS model attached.");
      57    125784200 :     return eos->ComputeT(density, momentumx, momentumy, E, Tguess, X, i , j, k, rtol);
      58              : }
      59        22248 : double Gas::ComputeT(
      60              :         double pressure, double density,
      61              :         Set::Patch<const Set::Scalar>& X, int i, int j, int k) const {
      62              :     // Temperature, K
      63        22248 :     if (!eos) Util::Abort(INFO, "[Gas::ComputeT] No EOS model attached.");
      64        22248 :     return eos->ComputeT(pressure, density, X, i , j, k);
      65              : }
      66    125784200 : double Gas::ComputeP(double density, double T, Set::Patch<const Set::Scalar>& X, int i, int j, int k) const {
      67              :     // Pressure, Pa
      68    125784200 :     if (!eos) Util::Abort(INFO, "[Gas::ComputeP] No EOS model attached.");
      69    125784200 :     return eos->ComputeP(density, T, X, i , j, k);
      70              : }
      71        22248 : double Gas::ComputeE(    
      72              :         double density, double momentumx, double momentumy, double T,
      73              :         Set::Patch<const Set::Scalar>& X, int i, int j, int k) const {
      74              :     // Energy, J/m^3
      75        22248 :     if (!eos) Util::Abort(INFO, "[Gas::ComputeE] No EOS model attached.");
      76        22248 :     return eos->ComputeE(density, momentumx, momentumy, T, X, i , j, k);
      77              : }
      78              : 
      79              : } // namespace Gas
      80              : } // namespace Model
        

Generated by: LCOV version 2.0-1