LCOV - code coverage report
Current view: top level - src/Model/Gas/EOS - CPG.cpp (source / functions) Coverage Total Hit
Test: coverage_merged.info Lines: 100.0 % 15 15
Test Date: 2026-03-09 13:26:47 Functions: 100.0 % 4 4

            Line data    Source code
       1              : #include "Model/Gas/Gas.H"
       2              : #include "Model/Gas/EOS/CPG.H"
       3              : 
       4              : namespace Model {
       5              : namespace Gas {
       6              : namespace EOS {
       7              : 
       8    125784200 : double CPG::ComputeT(double density, double momentumx, double momentumy, double E, double Tguess,
       9              :                 Set::Patch<const Set::Scalar>& X, int i, int j, int k, double /*rtol=1e-12*/) const {
      10              :     // Temperature, K
      11              :     // Since gamma is not a function of temperature, but is a function of composition, we can
      12              :     // compute gamma at any dummy temperature
      13    125784200 :     double P = (E - 0.5*(momentumx*momentumx + momentumy*momentumy)/density) * (gas->gamma(Tguess, X, i, j, k) - 1.0);
      14    125784200 :     double T = P / density / gas->R(X, i, j, k);
      15    125784200 :     return T;
      16              : }
      17        22248 : double CPG::ComputeT(double pressure, double density,
      18              :                 Set::Patch<const Set::Scalar>& X, int i, int j, int k) const {
      19              :     // Temperature, K
      20        22248 :     double T = pressure / density / gas->R(X, i, j, k);
      21        22248 :     return T;
      22              : }
      23    125784200 : double CPG::ComputeP(double density, double T,
      24              :                 Set::Patch<const Set::Scalar>& X, int i, int j, int k) const {
      25              :     // Pressure, Pa
      26    125784200 :     double P = density * gas->R(X, i, j, k) * T;
      27    125784200 :     return P;
      28              : }
      29        22248 : double CPG::ComputeE(double density, double momentumx, double momentumy, double T,
      30              :                 Set::Patch<const Set::Scalar>& X, int i, int j, int k) const {
      31              :     // Energy, J/m^3
      32        22248 :     double P = density * gas->R(X, i, j, k) * T;
      33        22248 :     double rhoE = P / (gas->gamma(T, X, i, j, k) - 1.0);
      34        22248 :     double E = rhoE + 0.5*(momentumx*momentumx + momentumy*momentumy)/density;
      35        22248 :     return E;
      36              : }
      37              : 
      38              : } // namespace EOS
      39              : } // namespace Gas
      40              : } // namespace Model
        

Generated by: LCOV version 2.0-1