Neko  0.8.1
A portable framework for high-order spectral element flow simulations
scalar_residual_sx.f90
Go to the documentation of this file.
1 
5  use operators
6  implicit none
7  private
8 
9  type, public, extends(scalar_residual_t) :: scalar_residual_sx_t
10  contains
11  procedure, nopass :: compute => scalar_residual_sx_compute
12  end type scalar_residual_sx_t
13 
14 contains
15 
16  subroutine scalar_residual_sx_compute(Ax, s, s_res, f_Xh, c_Xh, msh, Xh, &
17  lambda, rhocp, bd, dt, n)
18  class(ax_t), intent(in) :: Ax
19  type(mesh_t), intent(inout) :: msh
20  type(space_t), intent(inout) :: Xh
21  type(field_t), intent(inout) :: s
22  type(field_t), intent(inout) :: s_res
23  type(field_t), intent(inout) :: f_Xh
24  type(coef_t), intent(inout) :: c_Xh
25  real(kind=rp), intent(in) :: lambda
26  real(kind=rp), intent(in) :: rhocp
27  real(kind=rp), intent(in) :: bd
28  real(kind=rp), intent(in) :: dt
29  integer, intent(in) :: n
30  integer :: i
31 
32  do i = 1, n
33  c_xh%h1(i,1,1,1) = lambda
34  ! todo :should not be just rho here.
35  c_xh%h2(i,1,1,1) = rhocp * (bd / dt)
36  end do
37  c_xh%ifh2 = .true.
38 
39  call ax%compute(s_res%x, s%x, c_xh, msh, xh)
40 
41  do i = 1, n
42  s_res%x(i,1,1,1) = (-s_res%x(i,1,1,1)) + f_xh%x(i,1,1,1)
43  end do
44 
45  end subroutine scalar_residual_sx_compute
46 
47 end module scalar_residual_sx
Gather-scatter.
Operators.
Definition: operators.f90:34
Residuals in the Pn-Pn formulation (SX version)
subroutine scalar_residual_sx_compute(Ax, s, s_res, f_Xh, c_Xh, msh, Xh, lambda, rhocp, bd, dt, n)
Defines the residual for the scalar transport equation.
Abstract type to compute scalar residual.