Neko  0.8.99
A portable framework for high-order spectral element flow simulations
advection.f90
Go to the documentation of this file.
1 ! Copyright (c) 2021-2024, 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 !
34 module advection
35  use num_types, only : rp
36  use space, only : space_t
37  use field, only : field_t
38  use coefs, only : coef_t
39  use json_module, only : json_file
40  use field_series, only: field_series_t
42  implicit none
43  private
44 
46  type, public, abstract :: advection_t
47  contains
48  procedure(compute_adv), pass(this), deferred :: compute
49  procedure(compute_scalar_adv), pass(this), deferred :: compute_scalar
50  procedure(advection_free), pass(this), deferred :: free
51  end type advection_t
52 
53  interface
54 
65  module subroutine advection_factory(object, json, coef, &
66  ulag, vlag, wlag, &
67  dtlag, tlag, time_scheme, slag)
68  class(advection_t), allocatable, intent(inout) :: object
69  type(json_file), intent(inout) :: json
70  type(coef_t), intent(inout), target :: coef
71  type(field_series_t), intent(in), target :: ulag, vlag, wlag
72  real(kind=rp), intent(in), target :: dtlag(10)
73  real(kind=rp), intent(in), target :: tlag(10)
74  type(time_scheme_controller_t), intent(in), target :: time_scheme
75  type(field_series_t), target, optional :: slag
76  end subroutine advection_factory
77  end interface
78 
79  public :: advection_factory
80 
81  abstract interface
82 
94  subroutine compute_adv(this, vx, vy, vz, fx, fy, fz, Xh, coef, n, dt)
95  import :: advection_t
96  import :: coef_t
97  import :: space_t
98  import :: field_t
99  import :: rp
100  class(advection_t), intent(inout) :: this
101  type(space_t), intent(inout) :: Xh
102  type(coef_t), intent(inout) :: coef
103  type(field_t), intent(inout) :: vx, vy, vz
104  type(field_t), intent(inout) :: fx, fy, fz
105  integer, intent(in) :: n
106  real(kind=rp), intent(in), optional :: dt
107  end subroutine compute_adv
108  end interface
109 
110  abstract interface
111 
122  subroutine compute_scalar_adv(this, vx, vy, vz, s, fs, Xh, coef, n, dt)
123  import :: advection_t
124  import :: coef_t
125  import :: space_t
126  import :: field_t
127  import :: rp
128  class(advection_t), intent(inout) :: this
129  type(field_t), intent(inout) :: vx, vy, vz
130  type(field_t), intent(inout) :: s
131  type(field_t), intent(inout) :: fs
132  type(space_t), intent(inout) :: Xh
133  type(coef_t), intent(inout) :: coef
134  integer, intent(in) :: n
135  real(kind=rp), intent(in), optional :: dt
136  end subroutine compute_scalar_adv
137  end interface
138 
139  abstract interface
140 
141  subroutine advection_free(this)
142  import :: advection_t
143  class(advection_t), intent(inout) :: this
144  end subroutine advection_free
145  end interface
146 
147 end module advection
A factory for advection_t decendants. Both creates and initializes the object.
Definition: advection.f90:94
Add advection operator to the right-hand-side for a scalar.
Definition: advection.f90:122
Subroutines to add advection terms to the RHS of a transport equation.
Definition: advection.f90:34
Coefficients.
Definition: coef.f90:34
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
Defines a function space.
Definition: space.f90:34
Compound scheme for the advection and diffusion operators in a transport equation.
Base class for time integration schemes.
Definition: time_scheme.f90:61
Base abstract type for computing the advection operator.
Definition: advection.f90:46
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition: coef.f90:55
The function space for the SEM solution fields.
Definition: space.f90:62
Implements the logic to compute the time coefficients for the advection and diffusion operators in a ...