My Project
programmer's documentation
Functions
cs_hgn_thermo.h File Reference
#include "cs_defs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
Include dependency graph for cs_hgn_thermo.h:

Go to the source code of this file.

Functions

cs_real_t cs_hgn_thermo_saturation_temp (cs_real_t pr)
 Computation of the temperature at saturation with respect to the pressure. More...
 
void cs_hgn_thermo_pt (cs_real_t alpha, cs_real_t y, cs_real_t z, cs_real_t e, cs_real_t v, cs_real_t *ptp, cs_real_t *ppr)
 Computation mixture pressure and temperature from volume, mass, energy fractions, as well as specific energy and specific volume. More...
 
cs_real_t cs_hgn_thermo_c2 (cs_real_t alpha, cs_real_t y, cs_real_t z, cs_real_t P, cs_real_t v)
 Computation of the square of the sound speed in the mixture. More...
 
cs_real_t cs_hgn_thermo_ie (cs_real_t alpha, cs_real_t y, cs_real_t z, cs_real_t pr, cs_real_t v)
 Computation of the specific internal energy with respect to the volume ( $\alpha$), mass ( $y$) and energy ( $z$) fractions, as well as the pressure and the specific volume $\tau$. More...
 
void cs_hgn_thermo_eq (cs_real_t e, cs_real_t v, cs_real_t *palpha_eq, cs_real_t *py_eq, cs_real_t *pz_eq)
 Computation of the equilibrium fractions. More...
 

Function Documentation

◆ cs_hgn_thermo_c2()

cs_real_t cs_hgn_thermo_c2 ( cs_real_t  alpha,
cs_real_t  y,
cs_real_t  z,
cs_real_t  P,
cs_real_t  v 
)

Computation of the square of the sound speed in the mixture.

The sound speed may be computed through the Hessian matrices of the specific phasic entropies in the plane ( $\tau$, $e$). $\tau$ stands for specific volume, and $e$ for specific energy. The sound speed is here estimated using the plane ( $\tau$, $s$). $s$ stands for specific entropy. We use the definition

\[ c^2 = -\tau^2 \der{P}{\tau}_{|s,y} \]

. This relation is computed by a finite difference.

Parameters
[in]alphavolume fraction
[in]ymass fraction
[in]zenergy fraction
[in]Ppressure
[in]vspecific volume
Returns
square of the sound speed.

◆ cs_hgn_thermo_eq()

void cs_hgn_thermo_eq ( cs_real_t  e,
cs_real_t  v,
cs_real_t palpha_eq,
cs_real_t py_eq,
cs_real_t pz_eq 
)

Computation of the equilibrium fractions.

The equilibrium fractions correspond to the definition of the mixture for which one gets the pressure, temperature and chemical potential equilibrium.

They are computed by using a Dichotomy algorithm on the function characterizing the equilibrium (two forms available).

The search for the equilibrium point is done in plane (P,T). Dichotomy is performed on the pressure along the saturation curve.

Parameters
[in]especific internal energy
[in]vspecific volume
[out]palpha_eqpointer to equilibrium volume fraction
[out]py_eqpointer to equilibrium mass fraction
[out]pz_eqpointer to equilibrium energy fraction

◆ cs_hgn_thermo_ie()

cs_real_t cs_hgn_thermo_ie ( cs_real_t  alpha,
cs_real_t  y,
cs_real_t  z,
cs_real_t  pr,
cs_real_t  v 
)

Computation of the specific internal energy with respect to the volume ( $\alpha$), mass ( $y$) and energy ( $z$) fractions, as well as the pressure and the specific volume $\tau$.

It uses a quasi-Newton method to solve:

\[ \mathcal{P}(\alpha, y, z, e, \tau) = P \]

Parameters
[in]alphathe volume fraction
[in]ythe mass fraction
[in]zthe energy fraction
[in]prthe pressure
[in]vthe specific volume
Returns
specific internal energy.

◆ cs_hgn_thermo_pt()

void cs_hgn_thermo_pt ( cs_real_t  alpha,
cs_real_t  y,
cs_real_t  z,
cs_real_t  e,
cs_real_t  v,
cs_real_t ptp,
cs_real_t ppr 
)

Computation mixture pressure and temperature from volume, mass, energy fractions, as well as specific energy and specific volume.

Following relations are used, that rely on phasic pressures and temperatures:

\[ \dfrac{1}{T} = \dfrac{\dd s}{\dd e}_{|\tau,\alpha,y,z} \]

\[ \dfrac{P}{T} = \dfrac{\dd s}{\dd \tau}_{|e,\alpha,y,z} \]

Parameters
[in]alphavolume fraction
[in]ymass fraction
[in]zenergy fraction
[in]especific energy
[in]vspecific volume
[out]ptppointer to mixture temperature
[out]pprpointer to mixture pressure

◆ cs_hgn_thermo_saturation_temp()

cs_real_t cs_hgn_thermo_saturation_temp ( cs_real_t  pr)

Computation of the temperature at saturation with respect to the pressure.

Compute the temperature at saturation $T_{sat}$ with respect to the pressure $P$. It corresponds to the temperature for which the pressure, temperature and chemical potential are equal in both phases. It reduces to solve the equality of the phasic chemical potential:

\[ P \rightarrow T_{sat} \/ \mu_1(T_{sat},P)=\mu_2(T_{sat},P) \]

This equality is solved using a Newton method.

Parameters
[in]prpressure
Returns
temperature at saturation

Compute the temperature at saturation $T_{sat}$ with respect to the pressure $P$. It corresponds to the temperature for which the pressure, temperature and chemical potential are equal in both phases. It reduces to solve the equality of the phasic chemical potential:

\[ P \rightarrow T_{sat} \/ \mu_1(T_{sat},P)=\mu_2(T_{sat},P) \]

This equality is solved using a secant method.

Parameters
[in]prpressure
Returns
temperature at saturation