Neko 1.99.1
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
fluid_source_term.f90
Go to the documentation of this file.
1
2! Copyright (c) 2023, The Neko Authors
3! All rights reserved.
4!
5! Redistribution and use in source and binary forms, with or without
6! modification, are permitted provided that the following conditions
7! are met:
8!
9! * Redistributions of source code must retain the above copyright
10! notice, this list of conditions and the following disclaimer.
11!
12! * Redistributions in binary form must reproduce the above
13! copyright notice, this list of conditions and the following
14! disclaimer in the documentation and/or other materials provided
15! with the distribution.
16!
17! * Neither the name of the authors nor the names of its
18! contributors may be used to endorse or promote products derived
19! from this software without specific prior written permission.
20!
21! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32! POSSIBILITY OF SUCH DAMAGE.
33!
37 use source_term, only: source_term_t
39 use field, only: field_t
40 use field_list, only: field_list_t
41 use coefs, only: coef_t
42 use user_intf, only: user_t
43 implicit none
44 private
45
51
52 contains
54 procedure, pass(this) :: init => fluid_source_term_init
56 procedure, nopass :: init_user_source => fluid_init_user_source
57
58 end type fluid_source_term_t
59
60contains
61
63 subroutine fluid_source_term_init(this, f_x, f_y, f_z, coef, user, &
64 scheme_name)
65 class(fluid_source_term_t), intent(inout) :: this
66 type(field_t), pointer, intent(in) :: f_x, f_y, f_z
67 type(coef_t), target, intent(in) :: coef
68 type(user_t), target, intent(in) :: user
69 character(len=*), intent(in) :: scheme_name
70
71 type(field_list_t) :: rhs_fields
72
73 ! We package the fields for the source term to operate on in a field list.
74 call rhs_fields%init(3)
75 call rhs_fields%assign(1, f_x)
76 call rhs_fields%assign(2, f_y)
77 call rhs_fields%assign(3, f_z)
78
79 call this%init_base(rhs_fields, coef, user, scheme_name)
80 end subroutine fluid_source_term_init
81
88 subroutine fluid_init_user_source(source_term, rhs_fields, coef, user, &
89 scheme_name)
90 class(source_term_t), allocatable, intent(inout) :: source_term
91 type(field_list_t) :: rhs_fields
92 type(coef_t), intent(in) :: coef
93 type(user_t), intent(in) :: user
94 character(len=*), intent(in) :: scheme_name
95
97
98 select type (source_term)
99 type is (user_source_term_t)
100 call source_term%init_from_components(rhs_fields, coef, &
101 user%source_term, scheme_name)
102 end select
103 end subroutine fluid_init_user_source
104
105end module fluid_source_term
Coefficients.
Definition coef.f90:34
Defines a field.
Definition field.f90:34
Implements the fluid_source_term_t type.
subroutine fluid_init_user_source(source_term, rhs_fields, coef, user, scheme_name)
Initialize the user source term.
subroutine fluid_source_term_init(this, f_x, f_y, f_z, coef, user, scheme_name)
Constructor.
Implements the source_term_handler_t type.
Implements the source_term_t type and a wrapper source_term_wrapper_t.
Interfaces for user interaction with NEKO.
Definition user_intf.f90:34
Implements the user_source_term_t type.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:55
field_list_t, To be able to group fields together
Wrapper contaning and executing the fluid source terms.
Base abstract type for source terms.
Abstract class for handling source terms.
A type collecting all the overridable user routines and flag to suppress type injection from custom m...
A source term wrapping the user source term routine. Stores fields that are passed to the user routin...