47 use json_module,
only : json_file
64 type(
field_t),
intent(inout) :: u
65 type(
field_t),
intent(inout) :: v
66 type(
field_t),
intent(inout) :: w
67 type(
field_t),
intent(inout) :: p
68 type(
coef_t),
intent(in) :: coef
69 type(
gs_t),
intent(inout) :: gs
70 character(len=*) :: type
71 type(json_file),
intent(inout) :: params
72 real(kind=
rp) :: delta
73 real(kind=
rp),
allocatable :: uinf(:)
74 real(kind=
rp),
allocatable :: zone_value(:)
75 character(len=:),
allocatable :: blasius_approximation
76 character(len=:),
allocatable :: zone_name
78 if (trim(type) .eq.
'uniform')
then
79 call json_get(params,
'case.fluid.initial_condition.value', uinf)
81 else if (trim(type) .eq.
'blasius')
then
82 call json_get(params,
'case.fluid.blasius.delta', delta)
83 call json_get(params,
'case.fluid.blasius.approximation', &
84 blasius_approximation)
85 call json_get(params,
'case.fluid.blasius.freestream_velocity', uinf)
87 else if (trim(type) .eq.
'point_zone')
then
88 call json_get(params,
'case.fluid.initial_condition.base_value', uinf)
89 call json_get(params,
'case.fluid.initial_condition.zone_name', &
91 call json_get(params,
'case.fluid.initial_condition.zone_value', &
104 type(
field_t),
intent(inout) :: u
105 type(
field_t),
intent(inout) :: v
106 type(
field_t),
intent(inout) :: w
107 type(
field_t),
intent(inout) :: p
108 type(
coef_t),
intent(in) :: coef
109 type(
gs_t),
intent(inout) :: gs
110 procedure(
useric) :: usr_ic
111 type(json_file),
intent(inout) :: params
113 call usr_ic(u, v, w, p, params)
120 type(
field_t),
intent(inout) :: u
121 type(
field_t),
intent(inout) :: v
122 type(
field_t),
intent(inout) :: w
123 type(
field_t),
intent(inout) :: p
124 type(
coef_t),
intent(in) :: coef
125 type(
gs_t),
intent(inout) :: gs
140 call gs%op(u%x, u%dof%size(), gs_op_add)
141 call gs%op(v%x, v%dof%size(), gs_op_add)
142 call gs%op(w%x, w%dof%size(), gs_op_add)
149 call col2(u%x, coef%mult, u%dof%size())
150 call col2(v%x, coef%mult, v%dof%size())
151 call col2(w%x, coef%mult, w%dof%size())
158 type(
field_t),
intent(inout) :: u
159 type(
field_t),
intent(inout) :: v
160 type(
field_t),
intent(inout) :: w
161 real(kind=
rp),
intent(in) :: uinf(3)
168 call cfill(u%x, uinf(1), n)
169 call cfill(v%x, uinf(2), n)
170 call cfill(w%x, uinf(3), n)
178 type(
field_t),
intent(inout) :: u
179 type(
field_t),
intent(inout) :: v
180 type(
field_t),
intent(inout) :: w
181 real(kind=
rp),
intent(in) :: delta
182 real(kind=
rp),
intent(in) :: uinf(3)
183 character(len=*),
intent(in) :: type
187 select case(trim(type))
199 call neko_error(
'Invalid Blasius approximation')
202 if ((uinf(1) .gt. 0.0_rp) .and. (uinf(2) .eq. 0.0_rp) &
203 .and. (uinf(3) .eq. 0.0_rp))
then
204 do i = 1, u%dof%size()
205 u%x(i,1,1,1) = bla(u%dof%z(i,1,1,1), delta, uinf(1))
206 v%x(i,1,1,1) = 0.0_rp
207 w%x(i,1,1,1) = 0.0_rp
209 else if ((uinf(1) .eq. 0.0_rp) .and. (uinf(2) .gt. 0.0_rp) &
210 .and. (uinf(3) .eq. 0.0_rp))
then
211 do i = 1, u%dof%size()
212 u%x(i,1,1,1) = 0.0_rp
213 v%x(i,1,1,1) = bla(u%dof%x(i,1,1,1), delta, uinf(2))
214 w%x(i,1,1,1) = 0.0_rp
216 else if ((uinf(1) .eq. 0.0_rp) .and. (uinf(2) .eq. 0.0_rp) &
217 .and. (uinf(3) .gt. 0.0_rp))
then
218 do i = 1, u%dof%size()
219 u%x(i,1,1,1) = 0.0_rp
220 v%x(i,1,1,1) = 0.0_rp
221 w%x(i,1,1,1) = bla(u%dof%y(i,1,1,1), delta, uinf(3))
237 type(
field_t),
intent(inout) :: u
238 type(
field_t),
intent(inout) :: v
239 type(
field_t),
intent(inout) :: w
240 real(kind=
rp),
intent(in),
dimension(3) :: base_value
241 character(len=*),
intent(in) :: zone_name
242 real(kind=
rp),
intent(in) :: zone_value(:)
253 call cfill_mask(u%x, zone_value(1),
size, zone%mask, zone%size)
254 call cfill_mask(v%x, zone_value(2),
size, zone%mask, zone%size)
255 call cfill_mask(w%x, zone_value(3),
size, zone%mask, zone%size)
Copy data between host and device (or device and device)
Abstract interface for computing a Blasius flow profile.
Retrieves a parameter by name or throws an error.
Abstract interface for user defined initial conditions.
subroutine, public device_col2(a_d, b_d, n)
Vector multiplication .
subroutine, public device_cfill_mask(a_d, c, size, mask_d, mask_size)
Fill a constant to a masked vector. .
subroutine, public device_cfill(a_d, c, n)
Set all elements to a constant c .
Device abstraction, common interface for various accelerators.
integer, parameter, public host_to_device
subroutine set_flow_ic_usr(u, v, w, p, coef, gs, usr_ic, params)
Set intial flow condition (user defined)
subroutine set_flow_ic_point_zone(u, v, w, base_value, zone_name, zone_value)
Set the initial condition of the flow based on a point zone.
subroutine set_flow_ic_int(u, v, w, p, coef, gs, type, params)
Set initial flow condition (builtin)
subroutine set_flow_ic_uniform(u, v, w, uinf)
Uniform initial condition.
subroutine set_flow_ic_common(u, v, w, p, coef, gs)
subroutine set_flow_ic_blasius(u, v, w, delta, uinf, type)
Set a Blasius profile as initial condition.
real(kind=rp) function, public blasius_quadratic(y, delta, u)
Quadratic approximate Blasius Profile .
real(kind=rp) function, public blasius_quartic(y, delta, u)
Quartic approximate Blasius Profile .
real(kind=rp) function, public blasius_sin(y, delta, u)
Sinusoidal approximate Blasius Profile .
real(kind=rp) function, public blasius_cubic(y, delta, u)
Cubic approximate Blasius Profile .
real(kind=rp) function, public blasius_linear(y, delta, u)
Linear approximate Blasius profile .
Utilities for retrieving parameters from the case files.
subroutine, public cfill(a, c, n)
Set all elements to a constant c .
subroutine, public col2(a, b, n)
Vector multiplication .
subroutine, public cfill_mask(a, c, size, mask, mask_size)
Fill a constant to a masked vector. .
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
type(point_zone_registry_t), target, public neko_point_zone_registry
Global point_zone registry.
Interfaces for user interaction with NEKO.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Base abstract type for point zones.