45 use json_module,
only : json_file
60 type(
field_t),
intent(inout) :: u
61 type(
field_t),
intent(inout) :: v
62 type(
field_t),
intent(inout) :: w
63 type(
field_t),
intent(inout) :: p
64 type(
coef_t),
intent(in) :: coef
65 type(
gs_t),
intent(inout) :: gs
66 character(len=*) :: type
67 type(json_file),
intent(inout) :: params
70 real(kind=rp) :: delta
71 real(kind=rp),
allocatable :: uinf(:)
72 character(len=:),
allocatable :: blasius_approximation
74 if (trim(type) .eq.
'uniform')
then
75 call json_get(params,
'case.fluid.initial_condition.value', uinf)
77 else if (trim(type) .eq.
'blasius')
then
78 call json_get(params,
'case.fluid.blasius.delta', delta)
79 call json_get(params,
'case.fluid.blasius.approximation',&
80 blasius_approximation)
81 call json_get(params,
'case.fluid.blasius.freestream_velocity', uinf)
93 type(
field_t),
intent(inout) :: u
94 type(
field_t),
intent(inout) :: v
95 type(
field_t),
intent(inout) :: w
96 type(
field_t),
intent(inout) :: p
97 type(
coef_t),
intent(in) :: coef
98 type(
gs_t),
intent(inout) :: gs
99 procedure(
useric) :: usr_ic
100 type(json_file),
intent(inout) :: params
102 call usr_ic(u, v, w, p, params)
109 type(
field_t),
intent(inout) :: u
110 type(
field_t),
intent(inout) :: v
111 type(
field_t),
intent(inout) :: w
112 type(
field_t),
intent(inout) :: p
113 type(
coef_t),
intent(in) :: coef
114 type(
gs_t),
intent(inout) :: gs
126 call gs%op(u%x, u%dof%size(), gs_op_add)
127 call gs%op(v%x, v%dof%size(), gs_op_add)
128 call gs%op(w%x, w%dof%size(), gs_op_add)
135 call col2(u%x, coef%mult, u%dof%size())
136 call col2(v%x, coef%mult, v%dof%size())
137 call col2(w%x, coef%mult, w%dof%size())
144 type(
field_t),
intent(inout) :: u
145 type(
field_t),
intent(inout) :: v
146 type(
field_t),
intent(inout) :: w
147 real(kind=rp),
intent(in) :: uinf(3)
154 call cfill(u%x, uinf(1), n)
155 call cfill(v%x, uinf(2), n)
156 call cfill(w%x, uinf(3), n)
164 type(
field_t),
intent(inout) :: u
165 type(
field_t),
intent(inout) :: v
166 type(
field_t),
intent(inout) :: w
167 real(kind=rp),
intent(in) :: delta
168 real(kind=rp),
intent(in) :: uinf(3)
169 character(len=*),
intent(in) :: type
173 select case(trim(type))
185 call neko_error(
'Invalid Blasius approximation')
188 if ((uinf(1) .gt. 0.0_rp) .and. (uinf(2) .eq. 0.0_rp) &
189 .and. (uinf(3) .eq. 0.0_rp))
then
190 do i = 1, u%dof%size()
191 u%x(i,1,1,1) = bla(u%dof%z(i,1,1,1), delta, uinf(1))
192 v%x(i,1,1,1) = 0.0_rp
193 w%x(i,1,1,1) = 0.0_rp
195 else if ((uinf(1) .eq. 0.0_rp) .and. (uinf(2) .gt. 0.0_rp) &
196 .and. (uinf(3) .eq. 0.0_rp))
then
197 do i = 1, u%dof%size()
198 u%x(i,1,1,1) = 0.0_rp
199 v%x(i,1,1,1) = bla(u%dof%x(i,1,1,1), delta, uinf(2))
200 w%x(i,1,1,1) = 0.0_rp
202 else if ((uinf(1) .eq. 0.0_rp) .and. (uinf(2) .eq. 0.0_rp) &
203 .and. (uinf(3) .gt. 0.0_rp))
then
204 do i = 1, u%dof%size()
205 u%x(i,1,1,1) = 0.0_rp
206 v%x(i,1,1,1) = 0.0_rp
207 w%x(i,1,1,1) = bla(u%dof%y(i,1,1,1), delta, uinf(3))
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)
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_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 blasius_quadratic(y, delta, u)
Quadratic approximate Blasius Profile .
real(kind=rp) function blasius_sin(y, delta, u)
Sinusoidal approximate Blasius Profile .
real(kind=rp) function blasius_cubic(y, delta, u)
Cubic approximate Blasius Profile .
real(kind=rp) function blasius_linear(y, delta, u)
Linear approximate Blasius profile .
real(kind=rp) function blasius_quartic(y, delta, u)
Quartic 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 .
integer, parameter neko_bcknd_device
Interfaces for user interaction with NEKO.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...