sourcemethod_LinearEuler2D_t Subroutine

public subroutine sourcemethod_LinearEuler2D_t(this)

Spatially-dependent linear relaxation (sponge / damping layer) source.

The relaxation rate sigma = s(6), in units of inverse seconds, is the reciprocal of a local damping time scale. It contributes

q_i = -sigma * s_i , i = 1,2,3 (u, v, P)

to the source term of the conservation law s_t + div(f) = q, relaxing the acoustic state toward the (motionless, unperturbed) background at rate sigma. Because a single rate is applied to the velocity and the pressure alike, the acoustic energy density decays as exp(-2sigmat) wherever sigma is constant, which is exactly the behaviour wanted from a sponge layer: no impedance mismatch is introduced between the damped and undamped regions by the source term itself.

The static background variables (c, rho0, sigma) carry no source, so they are held fixed in time.

Units: sigma [s^-1]; q_1, q_2 [m⋅s^-2]; q_3 [kg⋅m^-1⋅s^-3]. Expected input range: sigma >= 0. A negative sigma amplifies the solution and is not a supported configuration.

Note: sourcemethod is overridden rather than source2d so that the solution gradient - which this model does not use - is never read.

Arguments

TypeIntentOptionalAttributesName
class(LinearEuler2D_t), intent(inout) :: this

Contents


Source Code

  subroutine sourcemethod_LinearEuler2D_t(this)
    !! Spatially-dependent linear relaxation (sponge / damping layer) source.
    !!
    !! The relaxation rate sigma = s(6), in units of inverse seconds, is the
    !! reciprocal of a local damping time scale. It contributes
    !!
    !!   q_i = -sigma * s_i ,   i = 1,2,3   (u, v, P)
    !!
    !! to the source term of the conservation law s_t + div(f) = q, relaxing
    !! the acoustic state toward the (motionless, unperturbed) background at
    !! rate sigma. Because a single rate is applied to the velocity and the
    !! pressure alike, the acoustic energy density decays as exp(-2*sigma*t)
    !! wherever sigma is constant, which is exactly the behaviour wanted from
    !! a sponge layer: no impedance mismatch is introduced between the damped
    !! and undamped regions by the source term itself.
    !!
    !! The static background variables (c, rho0, sigma) carry no source, so
    !! they are held fixed in time.
    !!
    !! Units: sigma [s^-1]; q_1, q_2 [m⋅s^-2]; q_3 [kg⋅m^-1⋅s^-3].
    !! Expected input range: sigma >= 0. A negative sigma amplifies the
    !! solution and is not a supported configuration.
    !!
    !! Note: sourcemethod is overridden rather than source2d so that the
    !! solution gradient - which this model does not use - is never read.
    implicit none
    class(LinearEuler2D_t),intent(inout) :: this
    ! Local
    integer :: i,j,iel
    real(prec) :: sigma

    do concurrent(i=1:this%solution%N+1,j=1:this%solution%N+1, &
                  iel=1:this%mesh%nElem)

      sigma = this%solution%interior(i,j,iel,6)

      this%source%interior(i,j,iel,1) = -this%solution%interior(i,j,iel,1)*sigma
      this%source%interior(i,j,iel,2) = -this%solution%interior(i,j,iel,2)*sigma
      this%source%interior(i,j,iel,3) = -this%solution%interior(i,j,iel,3)*sigma
      this%source%interior(i,j,iel,4) = 0.0_prec ! sound speed; held fixed in time
      this%source%interior(i,j,iel,5) = 0.0_prec ! background density; held fixed in time
      this%source%interior(i,j,iel,6) = 0.0_prec ! relaxation rate; held fixed in time

    enddo

  endsubroutine sourcemethod_LinearEuler2D_t