Compute conservative fluxes from primitives at interface.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(conservative_compressible), | intent(inout) | :: | self | Conservative. |
||
| class(eos_object), | intent(in) | :: | eos | Equation of state. |
||
| real(kind=R8P), | intent(in) | :: | p | Pressure at interface. |
||
| real(kind=R8P), | intent(in) | :: | r | Density at interface. |
||
| real(kind=R8P), | intent(in) | :: | u | Velocity (normal component) at interface. |
||
| type(vector), | intent(in) | :: | normal | Normal (versor) of face where fluxes are given. |
elemental subroutine compute_fluxes_from_primitive(self, eos, p, r, u, normal)
!< Compute conservative fluxes from primitives at interface.
class(conservative_compressible), intent(inout) :: self !< Conservative.
class(eos_object), intent(in) :: eos !< Equation of state.
real(R8P), intent(in) :: p !< Pressure at interface.
real(R8P), intent(in) :: r !< Density at interface.
real(R8P), intent(in) :: u !< Velocity (normal component) at interface.
type(vector), intent(in) :: normal !< Normal (versor) of face where fluxes are given.
self%density = r * u
self%momentum = (r * u * u + p) * normal
self%energy = (r * eos%energy(density=r, pressure=p) + r * u * u * 0.5_R8P + p) * u
endsubroutine compute_fluxes_from_primitive