Define Euler 1D field that is a concrete extension of the abstract integrand type.
Euler 1D PDEs system field.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | private, | allocatable | :: | BC_L | Left boundary condition type. |
||
character(len=:), | private, | allocatable | :: | BC_R | Right boundary condition type. |
||
real(kind=R_P), | private | :: | Dx | = | 0._R_P | Space step. |
|
integer(kind=I_P), | private | :: | Nc | = | 0 | Number of conservative variables, Ns+2. |
|
integer(kind=I_P), | private | :: | Ng | = | 0 | Number of ghost cells for boundary conditions handling. |
|
integer(kind=I_P), | private | :: | Ni | = | 0 | Space dimension. |
|
integer(kind=I_P), | private | :: | Np | = | 0 | Number of primitive variables, Ns+4. |
|
integer(kind=I_P), | private | :: | Ns | = | 0 | Number of initial species. |
|
real(kind=R_P), | private, | allocatable | :: | U(:,:) | Integrand (state) variables, whole physical domain [1:Nc,1-Ng:Ni+Ng]. |
||
real(kind=R_P), | private, | allocatable | :: | cp0(:) | Specific heat cp of initial species [1:Ns]. |
||
real(kind=R_P), | private, | allocatable | :: | cv0(:) | Specific heat cv of initial species [1:Ns]. |
||
integer(kind=I_P), | private | :: | ord | = | 0 | Space accuracy formal order. |
|
real(kind=R_P), | private, | allocatable | :: | previous(:,:,:) | Previous time steps states [1:Nc,1-Ng:Ni+Ng,1:steps]. |
||
integer(kind=I_P), | private | :: | steps | = | 0 | Number of time steps stored. |
|
type(weno_interpolator_upwind), | private | :: | weno | WENO interpolator. |
procedure, public, pass(lhs) :: add => add_euler | Euler + Euler operator. |
procedure, public, pass(lhs) :: assign_integrand => euler_assign_euler | Euler = Euler. |
procedure, public, pass(lhs) :: assign_real => euler_assign_real | Euler = real. |
procedure, private, pass(self) :: conservative2primitive | Convert conservative variables to primitive ones. |
procedure, public, pass(self) :: destroy | Destroy field. |
procedure, public, pass(self) :: dt => compute_dt | Compute the current time step, by means of CFL condition. |
procedure, private, pass(self) :: impose_boundary_conditions | Impose boundary conditions. |
procedure, public, pass(self) :: init | Init field. |
procedure, public, pass(lhs) :: integrand_multiply_integrand => euler_multiply_euler | Euler * Euler operator. |
procedure, public, pass(lhs) :: integrand_multiply_real => euler_multiply_real | Euler * real operator. |
procedure, public, pass(lhs) :: local_error => euler_local_error | Local error. |
procedure, public, pass(self) :: output | Extract Euler field. |
procedure, public, pass(self) :: previous_step | Get a previous time step. |
procedure, private, pass(self) :: primitive2conservative | Convert primitive variables to conservative ones. |
procedure, public, pass(rhs) :: real_multiply_integrand => real_multiply_euler | Real * Euler operator. |
procedure, private, pass(self) :: reconstruct_interfaces_states | Reconstruct interfaces states. |
procedure, private, pass(self) :: riemann_solver | Solve the Riemann Problem at cell interfaces. |
procedure, public, pass(lhs) :: sub => sub_euler | Euler - Euler. |
procedure, public, pass(self) :: t => dEuler_dt | Time derivative, residuals function. |
procedure, public, pass(self) :: update_previous_steps | Update previous time steps. |
Compute total specific energy (per unit of mass). $$ E = \frac{p}{{\left( {\g - 1} \right)\r }} + \frac{{u^2 }}{2} $$
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | p | Pressure. |
||
real(kind=R_P), | intent(in) | :: | r | Density. |
||
real(kind=R_P), | intent(in) | :: | u | Module of velocity vector. |
||
real(kind=R_P), | intent(in) | :: | g | Specific heats ratio \(\frac{{c_p}}{{c_v}}\). |
Total specific energy (per unit of mass).
Compute total specific entalpy (per unit of mass). $$ H = \frac{{\g p}}{{\left( {\g - 1} \right)\r }} + \frac{{u^2 }}{2} $$
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | p | Pressure. |
||
real(kind=R_P), | intent(in) | :: | r | Density. |
||
real(kind=R_P), | intent(in) | :: | u | Module of velocity vector. |
||
real(kind=R_P), | intent(in) | :: | g | Specific heats ratio \(\frac{{c_p}}{{c_v}}\). |
Total specific entalpy (per unit of mass).
Compute the speed of sound for an ideal calorically perfect gas.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | p | Pressure. |
||
real(kind=R_P), | intent(in) | :: | r | Density. |
||
real(kind=R_P), | intent(in) | :: | g | Specific heats ratio \(\frac{{c_p}}{{c_v}}\). |
Speed of sound.
Add two Euler fields.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(in) | :: | lhs | Left hand side. |
||
class(integrand), | intent(in) | :: | rhs | Right hand side. |
Operator result.
Compute the current time step by means of CFL condition.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(in) | :: | self | Euler field. |
||
integer(kind=I_P), | intent(in) | :: | Nmax | Maximun number of iterates. |
||
real(kind=R_P), | intent(in) | :: | Tmax | Maximum time (ignored if Nmax>0). |
||
real(kind=R_P), | intent(in) | :: | t | Time. |
||
real(kind=R_P), | intent(in) | :: | CFL | CFL value. |
Time step.
Convert conservative variables to primitive variables.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(in) | :: | self | Euler field. |
||
real(kind=R_P), | intent(in) | :: | conservative(:) | Conservative variables. |
Primitive variables.
Time derivative of Euler field, the residuals function.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(in) | :: | self | Euler field. |
||
real(kind=R_P), | intent(in), | optional | :: | t | Time. |
Euler field time derivative.
Estimate local truncation error between 2 euler approximations.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(in) | :: | lhs | Left hand side. |
||
class(integrand), | intent(in) | :: | rhs | Right hand side. |
Error estimation.
Multiply an Euler field by another one.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(in) | :: | lhs | Left hand side. |
||
class(integrand), | intent(in) | :: | rhs | Right hand side. |
Operator result.
Multiply an Euler field by a real scalar.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(in) | :: | lhs | Left hand side. |
||
real(kind=R_P), | intent(in) | :: | rhs | Right hand side. |
Operator result.
Output the Euler field state (primitive variables).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(in) | :: | self | Euler field. |
Euler state vector.
Compute the pressure for an ideal calorically perfect gas.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | r | Density. |
||
real(kind=R_P), | intent(in) | :: | a | Speed of sound. |
||
real(kind=R_P), | intent(in) | :: | g | Specific heats ratio \(\frac{{c_p}}{{c_v}}\). |
Pressure.
Extract previous time solution of Euler field.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(in) | :: | self | Euler field. |
||
integer(kind=I_P), | intent(in) | :: | n | Time level. |
Previous time solution of Euler field.
Convert primitive variables to conservative variables.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(in) | :: | self | Euler field. |
||
real(kind=R_P), | intent(in) | :: | primitive(:) | Primitive variables. |
Conservative variables.
Compute the density for an ideal calorically perfect gas.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | p | Pressure. |
||
real(kind=R_P), | intent(in) | :: | a | Speed of sound. |
||
real(kind=R_P), | intent(in) | :: | g | Specific heats ratio \(\frac{{c_p}}{{c_v}}\). |
Density.
Multiply a real scalar by an Euler field.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | lhs | Left hand side. |
||
class(euler_1D), | intent(in) | :: | rhs | Right hand side. |
Operator result.
Compute inter states (23*-states) from state1 and state4.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | r1 | Density of state 1. |
||
real(kind=R_P), | intent(in) | :: | p1 | Pressure of state 1. |
||
real(kind=R_P), | intent(in) | :: | u1 | Velocity of state 1. |
||
real(kind=R_P), | intent(in) | :: | g1 | Specific heat ratio of state 1. |
||
real(kind=R_P), | intent(in) | :: | r4 | Density of state 4. |
||
real(kind=R_P), | intent(in) | :: | p4 | Pressure of state 4. |
||
real(kind=R_P), | intent(in) | :: | u4 | Velocity of state 4. |
||
real(kind=R_P), | intent(in) | :: | g4 | Specific heat ratio of state 4. |
||
real(kind=R_P), | intent(out) | :: | p | Pressure of the intermediate states. |
||
real(kind=R_P), | intent(out) | :: | S | Contact discontinuity signal velocity. |
||
real(kind=R_P), | intent(out) | :: | S1 | Left fastest signal velocity. |
||
real(kind=R_P), | intent(out) | :: | S4 | Right fastest signal velocity. |
Destroy field.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(inout) | :: | self | Euler field. |
Assign one Euler field to another.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(inout) | :: | lhs | Left hand side. |
||
class(integrand), | intent(in) | :: | rhs | Right hand side. |
Assign one real to an Euler field.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(inout) | :: | lhs | Left hand side. |
||
real(kind=R_P), | intent(in) | :: | rhs | Right hand side. |
Impose boundary conditions.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(in) | :: | self | Euler field. |
||
real(kind=R_P), | intent(inout) | :: | primitive(1:self%Np,1-self%Ng:self%Ni+self%Ng) | Primitive variables [1:Np,1-Ng:Ni+Ng]. |
Init field.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(inout) | :: | self | Euler field. |
||
integer(kind=I_P), | intent(in) | :: | Ni | Space dimension. |
||
integer(kind=I_P), | intent(in) | :: | Ns | Number of initial species. |
||
real(kind=R_P), | intent(in) | :: | Dx | Space step. |
||
character(len=*), | intent(in) | :: | BC_L | Left boundary condition type. |
||
character(len=*), | intent(in) | :: | BC_R | Right boundary condition type. |
||
real(kind=R_P), | intent(in) | :: | initial_state(:,:) | Initial state of primitive variables. |
||
real(kind=R_P), | intent(in) | :: | cp0(:) | Initial specific heat, constant pressure. |
||
real(kind=R_P), | intent(in) | :: | cv0(:) | Initial specific heat, constant volume. |
||
integer(kind=I_P), | intent(in), | optional | :: | steps | Time steps stored. |
|
integer(kind=I_P), | intent(in), | optional | :: | ord | Space accuracy formal order. |
Reconstruct the interfaces states (into primitive variables formulation) by the requested order of accuracy.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(in) | :: | self | Euler field. |
||
real(kind=R_P), | intent(in) | :: | primitive(1:self%Np,1-self%Ng:self%Ni+self%Ng) | Primitive variables. |
||
real(kind=R_P), | intent(inout) | :: | r_primitive(1:self%Np,1:2,0:self%Ni+1) | Reconstructed primitive variables. |
Solve the Riemann problem between the state $1$ and $4$ using the (local) Lax Friedrichs (Rusanov) solver.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(in) | :: | self | Euler field. |
||
real(kind=R_P), | intent(in) | :: | p1 | Pressure of state 1. |
||
real(kind=R_P), | intent(in) | :: | r1 | Density of state 1. |
||
real(kind=R_P), | intent(in) | :: | u1 | Velocity of state 1. |
||
real(kind=R_P), | intent(in) | :: | g1 | Specific heats ratio of state 1. |
||
real(kind=R_P), | intent(in) | :: | p4 | Pressure of state 4. |
||
real(kind=R_P), | intent(in) | :: | r4 | Density of state 4. |
||
real(kind=R_P), | intent(in) | :: | u4 | Velocity of state 4. |
||
real(kind=R_P), | intent(in) | :: | g4 | Specific heats ratio of state 4. |
||
real(kind=R_P), | intent(out) | :: | F(1:self%Nc) | Resulting fluxes. |
Update previous time steps.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D), | intent(inout) | :: | self | Euler field. |
||
class(integrand), | intent(in), | optional | :: | filter | Filter field displacement. |
|
real(kind=R_P), | intent(in), | optional | :: | weights(:) | Weights for filtering the steps. |