10 use,
intrinsic :: iso_c_binding, only: c_ptr, c_null_ptr
14 real(kind=rp) ::
perm = 0.0_rp
23 type(user_t),
intent(inout) :: u
31 real(kind=rp),
intent(in) :: t
32 integer,
intent(in) :: tstep
33 real(kind=rp),
intent(inout) :: rho, mu, cp, lambda
34 type(json_file),
intent(inout) :: params
36 real(kind=rp) :: re,
pe
38 call json_get(params,
"case.fluid.Re", re)
39 call json_get(params,
"case.fluid.perm",
perm)
40 call json_get(params,
"case.scalar.Pe",
pe)
56 type(field_t),
intent(inout) :: s
57 type(json_file),
intent(inout) :: params
59 real(kind=rp) :: z_value
62 do i = 1, s%dof%size()
63 z_value = s%dof%z(i, 1, 1, 1)
65 if (z_value > 0.0_rp)
then
66 s%x(i, 1, 1, 1) = 0.0_rp
68 s%x(i, 1, 1, 1) = 1.0_rp
77 class(fluid_user_source_term_t),
intent(inout) :: f
78 real(kind=rp),
intent(in) :: t
79 type(field_t),
pointer :: u, v, w, s
82 class(point_zone_t),
pointer :: my_point_zone
87 my_point_zone => neko_point_zone_registry%get_point_zone(
"lowperm")
92 do i = 1, my_point_zone%size
97 if (neko_bcknd_device .eq. 1)
then
100 host_to_device, .true.)
104 u => neko_field_registry%get_field(
'u')
105 v => neko_field_registry%get_field(
'v')
106 w => neko_field_registry%get_field(
'w')
108 if (neko_bcknd_device .eq. 1)
then
109 call device_col3(f%u_d, u%x_d,
resistance_d, f%dm%size())
110 call device_col3(f%v_d, v%x_d,
resistance_d, f%dm%size())
111 call device_col3(f%w_d, w%x_d,
resistance_d, f%dm%size())
User defined user region.
subroutine fluid_permeability(f, t)
Forcing.
subroutine user_setup(user)
Register user defined functions (see nekos user_intf.f90)
real(kind=rp), dimension(:), allocatable resistance
subroutine set_material_properties(t, tstep, rho, mu, cp, lambda, params)
Read the material properties from the JSON file.
subroutine initial_condition(s, params)
Set the initial condition for the scalar field.