Neko  0.8.1
A portable framework for high-order spectral element flow simulations
rhs_maker.f90
Go to the documentation of this file.
1 ! Copyright (c) 2018-2023, The Neko Authors
2 ! All rights reserved.
3 !
4 ! Redistribution and use in source and binary forms, with or without
5 ! modification, are permitted provided that the following conditions
6 ! are met:
7 !
8 ! * Redistributions of source code must retain the above copyright
9 ! notice, this list of conditions and the following disclaimer.
10 !
11 ! * Redistributions in binary form must reproduce the above
12 ! copyright notice, this list of conditions and the following
13 ! disclaimer in the documentation and/or other materials provided
14 ! with the distribution.
15 !
16 ! * Neither the name of the authors nor the names of its
17 ! contributors may be used to endorse or promote products derived
18 ! from this software without specific prior written permission.
19 !
20 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 ! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 ! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 ! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 ! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 ! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 ! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 ! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30 ! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 ! POSSIBILITY OF SUCH DAMAGE.
32 !
38 module rhs_maker
39  use num_types, only : rp
40  use field_series, only : field_series_t
41  use field, only : field_t
42  implicit none
43  private
44 
46  type, public, abstract :: rhs_maker_sumab_t
47  contains
48  procedure(rhs_maker_sumab), nopass, deferred :: compute_fluid
49  end type rhs_maker_sumab_t
50 
52  type, public, abstract :: rhs_maker_ext_t
53  contains
54  procedure(rhs_maker_ext), nopass, deferred :: compute_fluid
55  procedure(scalar_rhs_maker_ext), nopass, deferred :: compute_scalar
56  end type rhs_maker_ext_t
57 
59  type, public, abstract :: rhs_maker_bdf_t
60  contains
61  procedure(rhs_maker_bdf), nopass, deferred :: compute_fluid
62  procedure(scalar_rhs_maker_bdf), nopass, deferred :: compute_scalar
63  end type rhs_maker_bdf_t
64 
65  abstract interface
66  subroutine rhs_maker_sumab(u, v, w, uu, vv, ww, uulag, vvlag, wwlag, ab, nab)
67  import field_t
68  import field_series_t
69  import rp
70  type(field_t), intent(inout) :: u, v, w
71  type(field_t), intent(inout) :: uu, vv, ww
72  type(field_series_t), intent(inout) :: uulag, vvlag, wwlag
73  real(kind=rp), dimension(3), intent(in) :: ab
74  integer, intent(in) :: nab
75  end subroutine rhs_maker_sumab
76  end interface
77 
78  abstract interface
79  subroutine rhs_maker_ext(fx_lag, fy_lag, fz_lag, &
80  fx_laglag, fy_laglag, fz_laglag, fx, fy, fz, &
81  rho, ext_coeffs, n)
82  import field_t
83  import rp
84  type(field_t), intent(inout) :: fx_lag, fy_lag, fz_lag
85  type(field_t), intent(inout) :: fx_laglag, fy_laglag, fz_laglag
86  real(kind=rp), intent(inout) :: rho, ext_coeffs(4)
87  integer, intent(in) :: n
88  real(kind=rp), intent(inout) :: fx(n), fy(n), fz(n)
89  end subroutine rhs_maker_ext
90  end interface
91 
92  abstract interface
93  subroutine scalar_rhs_maker_ext(fs_lag, fs_laglag, fs, rho, &
94  ext_coeffs, n)
95  import field_t
96  import rp
97  type(field_t), intent(inout) :: fs_lag
98  type(field_t), intent(inout) :: fs_laglag
99  real(kind=rp), intent(inout) :: rho, ext_coeffs(4)
100  integer, intent(in) :: n
101  real(kind=rp), intent(inout) :: fs(n)
102  end subroutine scalar_rhs_maker_ext
103  end interface
104 
105  abstract interface
106  subroutine rhs_maker_bdf(ulag, vlag, wlag, bfx, bfy, bfz, &
107  u, v, w, B, rho, dt, bd, nbd, n)
108  import field_series_t
109  import field_t
110  import rp
111  integer, intent(in) :: n, nbd
112  type(field_t), intent(in) :: u, v, w
113  type(field_series_t), intent(in) :: ulag, vlag, wlag
114  real(kind=rp), intent(inout) :: bfx(n), bfy(n), bfz(n)
115  real(kind=rp), intent(in) :: b(n)
116  real(kind=rp), intent(in) :: dt, rho, bd(4)
117  end subroutine rhs_maker_bdf
118  end interface
119 
120  abstract interface
121  subroutine scalar_rhs_maker_bdf(s_lag, fs, s, B, rho, dt,&
122  bd, nbd, n)
123  import field_series_t
124  import field_t
125  import rp
126  integer, intent(in) :: n, nbd
127  type(field_t), intent(in) :: s
128  type(field_series_t), intent(in) :: s_lag
129  real(kind=rp), intent(inout) :: fs(n)
130  real(kind=rp), intent(in) :: b(n)
131  real(kind=rp), intent(in) :: dt, rho, bd(4)
132  end subroutine scalar_rhs_maker_bdf
133  end interface
134 
135 end module rhs_maker
Stores a series fields.
Defines a field.
Definition: field.f90:34
integer, parameter, public rp
Global precision used in computations.
Definition: num_types.f90:12
Routines to generate the right-hand sides for the convection-diffusion equation. Employs the EXT/BDF ...
Definition: rhs_maker.f90:38
Abstract type to add contributions to F from lagged BD terms.
Definition: rhs_maker.f90:59
Abstract type to sum up contributions to kth order extrapolation scheme.
Definition: rhs_maker.f90:52
Abstract type to compute extrapolated velocity field for the pressure equation.
Definition: rhs_maker.f90:46