Compute conservative fluxes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(conservative_compressible), | intent(in) | :: | self | Conservative. |
||
| class(eos_object), | intent(in) | :: | eos | Equation of state. |
||
| type(vector), | intent(in) | :: | normal | Normal (versor) of face where fluxes are given. |
||
| class(conservative_object), | intent(out) | :: | fluxes | Conservative fluxes. |
subroutine compute_fluxes(self, eos, normal, fluxes)
!< Compute conservative fluxes.
class(conservative_compressible), intent(in) :: self !< Conservative.
class(eos_object), intent(in) :: eos !< Equation of state.
type(vector), intent(in) :: normal !< Normal (versor) of face where fluxes are given.
class(conservative_object), intent(out) :: fluxes !< Conservative fluxes.
real(R8P) :: pressure_ !< Pressure value.
type(vector) :: velocity_ !< Velocity vector.
real(R8P) :: velocity_normal_ !< Velocity component parallel to given normal.
select type(fluxes)
class is(conservative_compressible)
pressure_ = self%pressure(eos=eos)
velocity_ = self%velocity()
velocity_normal_ = velocity_.dot.normal
fluxes%density = self%momentum.dot.normal
fluxes%momentum = self%density * velocity_ * velocity_normal_ + pressure_ * normal
fluxes%energy = (self%energy + pressure_) * velocity_normal_
endselect
endsubroutine compute_fluxes