38 use json_module,
only : json_file
64 real(kind=
rp) :: ref_value = 0
73 procedure, pass(this) :: init_from_compenents => &
90 type(json_file),
intent(inout) :: json
92 type(
coef_t),
intent(in),
target :: coef
93 character(len=*),
intent(in) :: variable_name
94 real(kind=
rp),
allocatable :: values(:)
95 real(kind=
rp) :: start_time, end_time, ref_value
96 character(len=:),
allocatable :: scalar_name
97 real(kind=
rp),
allocatable :: g(:)
100 if (.not. fields%size() == 3)
then
101 call neko_error(
"Boussinesq term expects 3 fields to work on.")
110 if (.not.
size(g) == 3)
then
111 call neko_error(
"The gravity vector should have 3 components")
114 call json_get(json,
"reference_value", ref_value)
118 ref_value, g, beta, coef, start_time, end_time)
132 scalar_name, ref_value, g, beta, coef, start_time, end_time)
135 character(len=*),
intent(in) :: scalar_name
136 real(kind=
rp),
intent(in) :: ref_value
137 real(kind=
rp),
intent(in) :: g(3)
138 real(kind=
rp),
intent(in) :: beta
140 real(kind=
rp),
intent(in) :: start_time
141 real(kind=
rp),
intent(in) :: end_time
144 call this%init_base(fields, coef, start_time, end_time)
151 this%ref_value = ref_value
160 call this%free_base()
170 integer :: n_fields, i, n
172 n_fields = this%fields%size()
173 n = this%fields%item_size(1)
177 this%ref_value, this%g, this%beta)
180 this%ref_value, this%g, this%beta)
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
Retrieves a parameter by name or throws an error.
Implements the cpu kernel for the boussinesq_source_term_t type.
subroutine, public boussinesq_source_term_compute_cpu(fields, s, ref_value, g, beta)
Computes the Boussinesq source term on the cpu.
Implements the device kernel for the boussinesq_source_term_t type.
subroutine, public boussinesq_source_term_compute_device(fields, s, ref_value, g, beta)
Computes the Boussinesq source term on the device.
Implements the boussinesq_source_term_t type.
subroutine boussinesq_source_term_init_from_json(this, json, fields, coef, variable_name)
The common constructor using a JSON object.
subroutine boussinesq_source_term_compute(this, time)
Computes the source term and adds the result to fields.
subroutine boussinesq_source_term_init_from_components(this, fields, scalar_name, ref_value, g, beta, coef, start_time, end_time)
The constructor from type components.
subroutine boussinesq_source_term_free(this)
Destructor.
Defines a registry for storing solution fields.
type(field_registry_t), target, public neko_field_registry
Global field registry.
Utilities for retrieving parameters from the case files.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Implements the source_term_t type and a wrapper source_term_wrapper_t.
Module with things related to the simulation time.
Bouyancy source term accroding to the Boussinesq approximation.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
field_list_t, To be able to group fields together
Base abstract type for source terms.
A struct that contains all info about the time, expand as needed.