|
Basilisk CFD
Adaptive Cartesian mesh PDE framework
|
#include "conservation.h"Go to the source code of this file.
Functions | |
| void | flux (const double *s, double *f, double *e) |
The system is entirely defined by the flux() function called by the generic solver for conservation laws. | |
Variables | |
| scalar | rho [] |
| The conserved scalars are the gas density \(\rho\) and the total energy \(E\). | |
| scalar | E [] |
| vector | w [] |
| scalar * | scalars = {rho, E} |
| vector * | vectors = {w} |
| double | gammao = 1.4 |
The system is entirely defined by the flux() function called by the generic solver for conservation laws.
as well as a function which, given the state of each quantity, returns the fluxes and the minimum/maximum eigenvalues (i.e.
The parameter passed to the function is the array s which contains the state variables for each conserved field, in the order of their definition above (i.e. scalars then vectors).
We first recover each value ( \(\rho\), \(E\), \(w_x\) and \(w_y\)) and then compute the corresponding fluxes (f[0], f[1], f[2] and f[3]).
The minimum and maximum eigenvalues for the Euler system are the characteristic speeds \(u \pm \sqrt(\gamma p / \rho)\).
Definition at line 63 of file compressible.h.
References c, dimension, E, f, gammao, i, p, rho, s, sq(), un, and x.
| scalar E[] |
Definition at line 50 of file compressible.h.
Referenced by flux().
| double gammao = 1.4 |
Definition at line 54 of file compressible.h.
Referenced by flux().
| scalar rho[] |
The conserved scalars are the gas density \(\rho\) and the total energy \(E\).
The Euler system of conservation laws for a compressible gas can be written
\[ \partial_t\left(\begin{array}{c} \rho \\ E \\ w_x \\ w_y \\ \end{array}\right) + \nabla_x \cdot\left(\begin{array}{c} w_x \\ \frac{w_x}{\rho} ( E + p ) \\ \frac{w_x^2}{\rho} + p \\ \frac{w_y w_x}{\rho} \\ \end{array}\right) + \nabla_y \cdot\left(\begin{array}{c} w_y \\ \frac{w_y}{\rho} ( E + p ) \\ \frac{w_y w_x}{\rho} \\ \frac{w_y^2}{\rho} + p \\ \end{array}\right) = 0 \]
with \(\rho\) the gas density, \(E\) the total energy, \(\mathbf{w}\) the gas momentum and \(p\) the pressure given by the equation of state
\[ p = (\gamma - 1)(E - \rho\mathbf{u}^2/2) \]
with \(\gamma\) the polytropic exponent. This system can be solved using the generic solver for systems of conservation laws. The only conserved vector is the momentum \(\mathbf{w}\). The constant \(\gamma\) is represented by gammao here, with a default value of 1.4.
Definition at line 50 of file compressible.h.
Referenced by flux().
Using the ideas of Kurganov and Tadmor, 2000 it is possible to write a generic solver for systems of conservation laws of the form
\[ \partial_t\left(\begin{array}{c} s_i\\ \mathbf{v}_j\\ \end{array}\right) + \nabla\cdot\left(\begin{array}{c} \mathbf{F}_i\\ \mathbf{T}_j\\ \end{array}\right) = 0 \]
where \(s_i\) is a list of scalar fields, \(\mathbf{v}_j\) a list of vector fields and \(\mathbf{F}_i\), \(\mathbf{T}_j\) are the corresponding vector (resp. tensor) fluxes.
Note that the Saint-Venant solver is a particular case of this generic algorithm.
The user must provide the lists of conserved scalar and vector fields
Definition at line 52 of file compressible.h.
Referenced by event_defaults(), and update_conservation().
Definition at line 53 of file compressible.h.
Referenced by event_defaults(), if(), and update_conservation().
| vector w[] |
Definition at line 51 of file compressible.h.
Referenced by energy(), event_defaults(), event_viscous_term(), interpolate_array(), inverse_wavelet(), length(), parabola_fit_add(), query_sum(), relax_viscosity(), runge_kutta(), sum_add_point(), sum_add_sum(), update(), util_lagrange(), vectors_add(), vertical_fluxes(), vertical_velocity(), and wavelet().