50 use json_module,
only : json_file
77 type(
field_t),
intent(inout) :: u
78 type(
field_t),
intent(inout) :: v
79 type(
field_t),
intent(inout) :: w
80 type(
field_t),
intent(inout) :: p
81 type(
coef_t),
intent(in) :: coef
82 type(
gs_t),
intent(inout) :: gs
83 character(len=*) :: type
84 type(json_file),
intent(inout) :: params
85 real(kind=
rp) :: delta, tol
86 real(kind=
rp),
allocatable :: uinf(:)
87 real(kind=
rp),
allocatable :: zone_value(:)
88 character(len=:),
allocatable :: read_str
89 character(len=NEKO_FNAME_LEN) :: fname, mesh_fname
90 logical :: interpolate
96 if (trim(type) .eq.
'uniform')
then
104 else if (trim(type) .eq.
'blasius')
then
107 call json_get(params,
'approximation', read_str)
115 else if (trim(type) .eq.
'point_zone')
then
118 call json_get(params,
'zone_name', read_str)
126 else if (trim(type) .eq.
'field')
then
128 call json_get(params,
'file_name', read_str)
129 fname = trim(read_str)
135 mesh_fname = trim(read_str)
149 type(
field_t),
target,
intent(inout) :: u
150 type(
field_t),
target,
intent(inout) :: v
151 type(
field_t),
target,
intent(inout) :: w
152 type(
field_t),
target,
intent(inout) :: p
153 type(
coef_t),
intent(in) :: coef
154 type(
gs_t),
intent(inout) :: gs
156 character(len=*),
intent(in) :: scheme_name
164 call fields%assign_to_field(1, u)
165 call fields%assign_to_field(2, v)
166 call fields%assign_to_field(3, w)
167 call fields%assign_to_field(4, p)
169 call user_proc(scheme_name, fields)
178 user_proc, scheme_name)
179 type(
field_t),
target,
intent(inout) :: rho
180 type(
field_t),
target,
intent(inout) :: u
181 type(
field_t),
target,
intent(inout) :: v
182 type(
field_t),
target,
intent(inout) :: w
183 type(
field_t),
target,
intent(inout) :: p
184 type(
coef_t),
intent(in) :: coef
185 type(
gs_t),
intent(inout) :: gs
187 character(len=*),
intent(in) :: scheme_name
192 call neko_log%message(
"Type: user (compressible flows)")
195 call fields%assign_to_field(1, rho)
196 call fields%assign_to_field(2, u)
197 call fields%assign_to_field(3, v)
198 call fields%assign_to_field(4, w)
199 call fields%assign_to_field(5, p)
200 call user_proc(scheme_name, fields)
213 call gs%op(p%x, p%dof%size(), gs_op_add)
214 call gs%op(rho%x, rho%dof%size(), gs_op_add)
217 call device_col2(rho%x_d, coef%mult_d, rho%dof%size())
220 call col2(rho%x, coef%mult, rho%dof%size())
221 call col2(p%x, coef%mult, p%dof%size())
227 type(
field_t),
intent(inout) :: u
228 type(
field_t),
intent(inout) :: v
229 type(
field_t),
intent(inout) :: w
230 type(
field_t),
intent(inout) :: p
231 type(
coef_t),
intent(in) :: coef
232 type(
gs_t),
intent(inout) :: gs
248 call gs%op(u%x, u%dof%size(), gs_op_add)
249 call gs%op(v%x, v%dof%size(), gs_op_add)
250 call gs%op(w%x, w%dof%size(), gs_op_add)
258 call col2(u%x, coef%mult, u%dof%size())
259 call col2(v%x, coef%mult, v%dof%size())
260 call col2(w%x, coef%mult, w%dof%size())
267 type(
field_t),
intent(inout) :: u
268 type(
field_t),
intent(inout) :: v
269 type(
field_t),
intent(inout) :: w
270 real(kind=
rp),
intent(in) :: uinf(3)
272 character(len=LOG_SIZE) :: log_buf
274 call neko_log%message(
"Type : uniform")
275 write (log_buf,
'(A, 3(ES12.6, A))')
"Value: [", &
276 (uinf(i),
", ", i = 1, 2), uinf(3),
"]"
284 call cfill(u%x, uinf(1), n)
285 call cfill(v%x, uinf(2), n)
286 call cfill(w%x, uinf(3), n)
294 type(
field_t),
intent(inout) :: u
295 type(
field_t),
intent(inout) :: v
296 type(
field_t),
intent(inout) :: w
297 real(kind=
rp),
intent(in) :: delta
298 real(kind=
rp),
intent(in) :: uinf(3)
299 character(len=*),
intent(in) :: type
302 character(len=LOG_SIZE) :: log_buf
304 call neko_log%message(
"Type : blasius")
305 write (log_buf,
'(A,ES12.6)')
"delta : ", delta
307 call neko_log%message(
"Approximation : " // trim(type))
308 write (log_buf,
'(A,"[",2(ES12.6,","),ES12.6,"]")')
"Value : ", &
309 uinf(1), uinf(2), uinf(3)
312 select case (trim(type))
326 call neko_error(
'Invalid Blasius approximation')
329 if ((uinf(1) .gt. 0.0_rp) .and.
abscmp(uinf(2), 0.0_rp) &
330 .and.
abscmp(uinf(3), 0.0_rp))
then
331 do i = 1, u%dof%size()
332 u%x(i,1,1,1) = bla(u%dof%z(i,1,1,1), delta, uinf(1))
333 v%x(i,1,1,1) = 0.0_rp
334 w%x(i,1,1,1) = 0.0_rp
336 else if (
abscmp(uinf(1), 0.0_rp) .and. (uinf(2) .gt. 0.0_rp) &
337 .and.
abscmp(uinf(3), 0.0_rp))
then
338 do i = 1, u%dof%size()
339 u%x(i,1,1,1) = 0.0_rp
340 v%x(i,1,1,1) = bla(u%dof%x(i,1,1,1), delta, uinf(2))
341 w%x(i,1,1,1) = 0.0_rp
343 else if (
abscmp(uinf(1), 0.0_rp) .and.
abscmp(uinf(2), 0.0_rp) &
344 .and. (uinf(3) .gt. 0.0_rp))
then
345 do i = 1, u%dof%size()
346 u%x(i,1,1,1) = 0.0_rp
347 v%x(i,1,1,1) = 0.0_rp
348 w%x(i,1,1,1) = bla(u%dof%y(i,1,1,1), delta, uinf(3))
364 type(
field_t),
intent(inout) :: u
365 type(
field_t),
intent(inout) :: v
366 type(
field_t),
intent(inout) :: w
367 real(kind=
rp),
intent(in),
dimension(3) :: base_value
368 character(len=*),
intent(in) :: zone_name
369 real(kind=
rp),
intent(in) :: zone_value(:)
370 character(len=LOG_SIZE) :: log_buf
376 call neko_log%message(
"Type : point_zone")
377 write (log_buf,
'(A,ES12.6)')
"Base value : ", base_value
379 call neko_log%message(
"Zone name : " // trim(zone_name))
380 write (log_buf,
'(A,"[",2(ES12.6,","),ES12.6," ]")')
"Value : ", &
381 zone_value(1), zone_value(2), zone_value(3)
389 call cfill_mask(u%x, zone_value(1),
size, zone%mask%get(), zone%size)
390 call cfill_mask(v%x, zone_value(2),
size, zone%mask%get(), zone%size)
391 call cfill_mask(w%x, zone_value(3),
size, zone%mask%get(), zone%size)
413 interpolate, tolerance, mesh_file_name)
414 type(
field_t),
target,
intent(inout) :: u
415 type(
field_t),
target,
intent(inout) :: v
416 type(
field_t),
target,
intent(inout) :: w
417 type(
field_t),
target,
intent(inout) :: p
418 character(len=*),
intent(inout) :: file_name
419 logical,
intent(in) :: interpolate
420 real(kind=
rp),
intent(in) :: tolerance
421 character(len=*),
intent(inout) :: mesh_file_name
423 type(
field_t),
pointer :: us, vs, ws, ps
431 u = us, v = vs, w = ws, p = ps, &
432 interpolate = interpolate, tolerance = tolerance)
434 nullify(us, vs, ws, ps)
Copy data between host and device (or device and device)
Synchronize a device or stream.
Abstract interface for computing a Blasius flow profile.
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.
Abstract interface for user defined initial conditions.
subroutine, public device_col2(a_d, b_d, n, strm)
Vector multiplication .
Device abstraction, common interface for various accelerators.
integer, parameter, public host_to_device
integer, parameter, public device_to_host
Module for file I/O operations.
Simple module to handle fld file series. Provides an interface to the different fields sotred in a fl...
subroutine set_flow_ic_usr(u, v, w, p, coef, gs, user_proc, scheme_name)
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_compressible_flow_ic_usr(rho, u, v, w, p, coef, gs, user_proc, scheme_name)
Set intial flow condition (user defined) for compressible flows.
subroutine set_flow_ic_uniform(u, v, w, uinf)
Uniform initial condition.
subroutine, public set_flow_ic_fld(u, v, w, p, file_name, interpolate, tolerance, mesh_file_name)
Set the initial condition of the flow based on a field. @detail The fields are read from an fld file....
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_tanh(y, delta, u)
Hyperbolic tangent approximate Blasius Profile from O. Savas (2012) where is the 99 percent thickne...
real(kind=rp) function, public blasius_linear(y, delta, u)
Linear approximate Blasius profile .
Implements global_interpolation given a dofmap.
Importation of fields from fld files.
subroutine, public import_fields(fname, mesh_fname, u, v, w, p, t, s_target_list, s_index_list, interpolate, tolerance)
Imports fields from an fld file, potentially with interpolation.
Routines to interpolate between different spaces.
Utilities for retrieving parameters from the case files.
type(log_t), public neko_log
Global log stream.
integer, parameter, public log_size
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, n, mask, n_mask)
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.
Defines a function space.
integer, parameter, public gll
Interfaces for user interaction with NEKO.
integer function, public extract_fld_file_index(fld_filename, default_index)
Extracts the index of a field file. For example, "myfield.f00045" will return 45. If the suffix of th...
integer, parameter, public neko_fname_len
subroutine, public neko_warning(warning_msg)
Reports a warning to standard output.
subroutine, public filename_chsuffix(fname, new_fname, new_suffix)
Change a filename's suffix.
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
A wrapper around a polymorphic generic_file_t that handles its init. This is essentially a factory fo...
Interface for NEKTON fld files.
Implements global interpolation for arbitrary points in the domain.
Interpolation between two space::space_t.
Base abstract type for point zones.
The function space for the SEM solution fields.