39 use json_module,
only : json_file
56 real(kind=
rp) :: omega(3)
58 real(kind=
rp) :: u_geo(3) = 0
63 procedure, pass(this) :: init_from_compenents => &
80 type(json_file),
intent(inout) :: json
82 type(
coef_t),
intent(in),
target :: coef
83 character(len=*),
intent(in) :: variable_name
85 real(kind=
rp),
allocatable :: rotation_vec(:), u_geo(:)
87 real(kind=
rp) :: omega, phi, f, pi
88 real(kind=
rp) :: start_time, end_time
93 if (json%valid_path(
"geostrophic_wind"))
then
94 call json_get(json,
"geostrophic_wind", u_geo)
100 if (json%valid_path(
"rotation_vector"))
then
101 call json_get(json,
"rotation_vector", rotation_vec)
102 else if (json%valid_path(
"omega") .and. json%valid_path(
"phi"))
then
106 allocate(rotation_vec(3))
107 pi = 4 * atan(1.0_rp)
108 rotation_vec(1) = 0.0_rp
109 rotation_vec(2) = omega * cos(phi * pi / 180 )
110 rotation_vec(3) = omega * sin(phi * pi / 180)
111 else if (json%valid_path(
"f"))
then
114 allocate(rotation_vec(3))
115 rotation_vec(1) = 0.0_rp
116 rotation_vec(2) = 0.0_rp
117 rotation_vec(3) = 0.5_rp * f
119 call neko_error(
"Specify either rotation_vector, phi and omega, or f &
120 & for the Coriolis source term.")
126 u_geo, coef, start_time, end_time)
138 u_geo, coef, start_time, end_time)
141 real(kind=
rp),
intent(in) :: omega(3)
142 real(kind=
rp),
intent(in) :: u_geo(3)
144 real(kind=
rp),
intent(in) :: start_time
145 real(kind=
rp),
intent(in) :: end_time
148 call this%init_base(fields, coef, start_time, end_time)
150 if (fields%size() .ne. 3)
then
151 call neko_error(
"Number of fields for the Coriolis force must be 3.")
162 call this%free_base()
170 type(
field_t),
pointer :: u, v, w
178 this%omega, this%u_geo)
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 coriolis_source_term_t type. Maintainer: Timofey Mukha.
subroutine, public coriolis_source_term_compute_cpu(u, v, w, fields, omega, u_geo)
Computes the generic Coriolis source term on the cpu.
Implements the device kernel for the coriolis_source_term_t type.
subroutine, public coriolis_source_term_compute_device(u, v, w, fields, omega, u_geo)
Computes the Coriolis source term on the device.
Implements the coriolis_source_term_t type. Maintainer: Timofey Mukha.
subroutine coriolis_source_term_compute(this, time)
Computes the source term and adds the result to fields.
subroutine coriolis_source_term_init_from_components(this, fields, omega, u_geo, coef, start_time, end_time)
The constructor from type components.
subroutine coriolis_source_term_free(this)
Destructor.
subroutine coriolis_source_term_init_from_json(this, json, fields, coef, variable_name)
The common constructor using a JSON object.
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.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
This source term adds the Coriolis force.
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.