Case for wind-turbine simulations (the two_turbines setup):
uniform inflow and convective outflow in x; y and z each either periodic
or bounded by free-slip walls (BC = 'neumann', 'neumann', Incompact3d
ncl = 1). Incompact3d's two_turbines example has walls in y and z.
The case owns a polymorphic turbine forcing model (turbine_model_t), set up
by m_turbine_setup from the iturbine switch. It drives the model from its
forcings()/postprocess() hooks.
The inflow/outflow boundary treatment mirrors m_case_cylinder.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(base_backend_t), | intent(inout), | target | :: | backend | ||
| type(mesh_t), | intent(inout), | target | :: | mesh | ||
| type(allocator_t), | intent(inout), | target | :: | host_allocator |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| class(solver_t), | public, | allocatable | :: | solver | |||
| type(io_manager_t), | public | :: | io_mgr | ||||
| type(monitoring_t), | public | :: | monitoring | ||||
| class(field_t), | public, | pointer | :: | bc_start_u_x | => | null() | |
| class(field_t), | public, | pointer | :: | bc_start_v_x | => | null() | |
| class(field_t), | public, | pointer | :: | bc_start_w_x | => | null() | |
| class(field_t), | public, | pointer | :: | bc_end_u_x | => | null() | |
| class(field_t), | public, | pointer | :: | bc_end_v_x | => | null() | |
| class(field_t), | public, | pointer | :: | bc_end_w_x | => | null() | |
| class(field_t), | public, | pointer | :: | bc_start_u_y | => | null() | |
| class(field_t), | public, | pointer | :: | bc_start_v_y | => | null() | |
| class(field_t), | public, | pointer | :: | bc_start_w_y | => | null() | |
| class(field_t), | public, | pointer | :: | bc_end_u_y | => | null() | |
| class(field_t), | public, | pointer | :: | bc_end_v_y | => | null() | |
| class(field_t), | public, | pointer | :: | bc_end_w_y | => | null() | |
| type(wind_turbine_config_t), | public | :: | wt_cfg | ||||
| class(turbine_model_t), | public, | pointer | :: | turbine | => | null() | |
| logical, | public | :: | y_walls | = | .false. |
Free-slip walls in y and in z |
|
| logical, | public | :: | z_walls | = | .false. |
Free-slip walls in y and in z |
|
| real(kind=dp), | public, | allocatable | :: | flow_rate_y_weights(:) |
Weights of the local y and z points in the outlet flow rate, see wall_weights |
||
| real(kind=dp), | public, | allocatable | :: | flow_rate_z_weights(:) |
Weights of the local y and z points in the outlet flow rate, see wall_weights |
| public function case_wind_turbine_init (backend, mesh, host_allocator) |
| procedure, public :: compute_outflow_params | |
| procedure, public :: outflow_flow_rate_correction | |
| procedure, public :: case_init | |
| procedure, public :: case_finalise | |
| procedure, public :: set_init | |
| procedure, public :: substep | |
| procedure, public :: set_curr_fields | |
| procedure, public :: finish_step | |
| procedure, public :: run | |
| procedure, public :: define_BC => define_BC_wind_turbine | |
| procedure, public :: initial_conditions => initial_conditions_wind_turbine | |
| procedure, public :: forcings => forcings_wind_turbine | |
| procedure, public :: apply_BC => apply_BC_wind_turbine | |
| procedure, public :: postprocess => postprocess_wind_turbine | |
| procedure, public :: post_step => post_step_wind_turbine | |
| procedure, public :: finalise_case_specific => finalise_wind_turbine |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(base_backend_t), | intent(inout), | target | :: | backend | ||
| type(mesh_t), | intent(inout), | target | :: | mesh | ||
| type(allocator_t), | intent(inout), | target | :: | host_allocator |
Whether direction dir has free-slip walls ('neumann' at both ends), stopping the run unless it is that or periodic at both ends.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh | |||
| integer, | intent(in) | :: | dir | |||
| character(len=*), | intent(in) | :: | name |
Weights of the local vertices of direction dir in the outlet flow rate, as the discrete divergence sees it: its interpolation along a non-periodic direction gives the global boundary planes half the weight of the others (trapezoid). u is not stamped on a free-slip wall, so the wall planes keep their 1/2.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh | |||
| integer, | intent(in) | :: | dir | |||
| logical, | intent(in) | :: | walls |
Deterministic seeding of the intrinsic RNG, distinct for every (rank, start iteration) pair. A fresh run starts at iter = 0.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nrank | |||
| integer, | intent(in) | :: | nproc | |||
| integer, | intent(in) | :: | iter |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(case_wind_turbine_t) | :: | self |
Boundary Conditions hook (called per substep before transeq). Builds the inlet Dirichlet profile only; outflow parameters are computed in apply_BC from the post-integration velocity. u = bc_start_u + inlet_noise(1) * um * (2r - 1) v = bc_start_v + inlet_noise(2) * um * (2r - 1) w = bc_start_w + inlet_noise(3) * um * (2r - 1)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(case_wind_turbine_t) | :: | self |
Pre-correction (called per substep after the integrator step), following Incompact3d's pre_correc: 1. cx = uxmaxgdt/dx from the post-integration field. 2. Dirichlet inflow at x=1 and convective outflow at x=nx for u,v,w: u(nx) = u(nx) - cx(u(nx) - u(nx-1)), with a uniform shift of u on the outlet that makes the flow rate out equal the flow rate in. Incompact3d balances the plain means over the planes; here the planes are weighted as the discrete divergence sees them (see wall_weights), the same thing for periodic y and z, and exact with walls, where the plain mean leaves a uniform divergence the Neumann-x projection cannot remove. 3. Free-slip walls: v = 0 on the y walls and w = 0 on the z walls. The tangential components take the even-symmetry closure, and the Neumann pressure BC gives no correction on the wall planes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(case_wind_turbine_t) | :: | self | ||||
| class(field_t), | intent(inout) | :: | u | |||
| class(field_t), | intent(inout) | :: | v | |||
| class(field_t), | intent(inout) | :: | w |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(case_wind_turbine_t) | :: | self | ||||
| class(field_t), | intent(inout) | :: | du | |||
| class(field_t), | intent(inout) | :: | dv | |||
| class(field_t), | intent(inout) | :: | dw | |||
| integer, | intent(in) | :: | iter |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(case_wind_turbine_t) | :: | self | ||||
| integer, | intent(in) | :: | iter | |||
| real(kind=dp), | intent(in) | :: | t |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(case_wind_turbine_t) | :: | self | ||||
| integer, | intent(in) | :: | iter | |||
| real(kind=dp), | intent(in) | :: | t |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(case_wind_turbine_t) | :: | self |