@@ -74,6 +74,7 @@ module self_LinearEuler2D_t
7474 procedure :: flux2d = > flux2d_LinearEuler2D_t
7575 procedure :: riemannflux2d = > riemannflux2d_LinearEuler2D_t
7676 ! procedure :: source2d => source2d_LinearEuler2D_t
77+ procedure :: SphericalSoundWave = > SphericalSoundWave_LinearEuler2D_t
7778
7879 endtype LinearEuler2D_t
7980
@@ -100,7 +101,7 @@ subroutine SetMetadata_LinearEuler2D_t(this)
100101 call this% solution% SetName(3 ," v" ) ! y-velocity component
101102 call this% solution% SetUnits(3 ," m⋅s⁻¹" )
102103
103- call this% solution% SetName(4 ," pressure " ) ! Pressure
104+ call this% solution% SetName(4 ," P " ) ! Pressure
104105 call this% solution% SetUnits(4 ," kg⋅m⁻¹⋅s⁻²" )
105106
106107 end subroutine SetMetadata_LinearEuler2D_t
@@ -188,4 +189,49 @@ pure function riemannflux2d_LinearEuler2D_t(this,sL,sR,dsdx,nhat) result(flux)
188189
189190 end function riemannflux2d_LinearEuler2D_t
190191
192+ subroutine SphericalSoundWave_LinearEuler2D_t (this ,rhoprime ,Lr ,x0 ,y0 )
193+ ! ! This subroutine sets the initial condition for a weak blast wave
194+ ! ! problem. The initial condition is given by
195+ ! !
196+ ! ! \begin{equation}
197+ ! ! \begin{aligned}
198+ ! ! \rho &= \rho_0 + \rho' \exp\left( -\ln(2) \frac{(x-x_0)^2 + (y-y_0)^2}{L_r^2} \right)
199+ ! ! u &= 0 \\
200+ !! v &= 0 \\
201+ !! E &= \frac{P_0}{\gamma - 1} + E \exp\left( -\ln(2) \frac{(x-x_0)^2 + (y-y_0)^2}{L_e^2} \right)
202+ ! ! \end{aligned}
203+ ! ! \end{equation}
204+ ! !
205+ implicit none
206+ class(LinearEuler2D_t),intent (inout ) :: this
207+ real (prec),intent (in ) :: rhoprime,Lr,x0,y0
208+ ! Local
209+ integer :: i,j,iEl
210+ real (prec) :: x,y,rho,r,E
211+
212+ print * ,__FILE__," : Configuring weak blast wave initial condition. "
213+ print * ,__FILE__," : rhoprime = " ,rhoprime
214+ print * ,__FILE__," : Lr = " ,Lr
215+ print * ,__FILE__," : x0 = " ,x0
216+ print * ,__FILE__," : y0 = " ,y0
217+
218+ do concurrent(i= 1 :this% solution% N+1 ,j= 1 :this% solution% N+1 , &
219+ iel= 1 :this% mesh% nElem)
220+ x = this% geometry% x% interior(i,j,iEl,1 ,1 )- x0
221+ y = this% geometry% x% interior(i,j,iEl,1 ,2 )- y0
222+ r = sqrt (x** 2 + y** 2 )
223+
224+ rho = (rhoprime)* exp (- log (2.0_prec )* r** 2 / Lr** 2 )
225+
226+ this% solution% interior(i,j,iEl,1 ) = rho
227+ this% solution% interior(i,j,iEl,2 ) = 0.0_prec
228+ this% solution% interior(i,j,iEl,3 ) = 0.0_prec
229+ this% solution% interior(i,j,iEl,4 ) = rho* this% c* this% c
230+
231+ enddo
232+
233+ call this% ReportMetrics()
234+
235+ end subroutine SphericalSoundWave_LinearEuler2D_t
236+
191237endmodule self_LinearEuler2D_t
0 commit comments