|
MFC
Exascale flow solver
|
Computes gravitational and body force source terms for the momentum equations. More...
Functions/Subroutines | |
| pure logical function | f_is_fluid_cell (marks, j, k, l) |
| True for a cell outside every immersed boundary. | |
| pure real(wp) function | f_fluid_volume (marks, j, k, l) |
| Volume of the fluid in cell (j, k, l): zero inside an immersed boundary. | |
| impure subroutine, public | s_initialize_body_forces_module |
| Initialize the body forces module. When synthetic_turbulence is enabled, generates random wave vectors for each energy shell on rank 0, then broadcasts to all MPI ranks and copies to GPU. | |
| impure subroutine | s_initialize_body_force_with_spatial_support |
| Initialize a body force with spatial support presented in Wei & Freund (JFM, 2005). | |
| subroutine | s_compute_acceleration (t) |
| Compute the acceleration at time t. | |
| subroutine | s_compute_body_force_with_spatial_support (t, bounds) |
| Apply the body force of Wei & Freund (JFM, 2005). | |
| subroutine | s_compute_mixture_density (q_cons_vf, bounds) |
| Compute the mixture density at each cell center. | |
| subroutine, public | s_compute_body_forces_rhs (q_prim_vf, q_cons_vf, rhs_vf, bounds, q_t_sf) |
| Compute the body force source terms for momentum and energy equations. | |
| subroutine | s_compute_mts_terms (q_cons_vf, q_t_sf) |
| Source terms of the thermally developed state, psi = T - T_s, central in x: g1 = rho cp u psi - d(lam psi)/dx - lam dpsi/dx, g2 = lam psi, for every cell. The applied source S = beta (g1 + beta g2) and the controller's A1 = sum(g1 dV), A2 = sum(g2
dV) share them. | |
| subroutine, public | s_apply_bodyforces (q_cons_vf, q_prim_vf_in, rhs_vf_in, ldt, q_t_sf) |
| Apply the body forces source term at each Runge-Kutta stage. | |
| subroutine, public | s_apply_synthetic_turbulence_force (q_cons_vf, q_prim_vf_in, rhs_vf_in, ldt) |
| Adds the synthetic turbulence forcing to the momentum and energy over the stage's local dt. | |
| impure subroutine | s_open_history (unit, fname) |
| Rank 0 opens a per-step history file in case_dir, appending on restart. | |
| subroutine | s_mean_controller (src, y, y_old, y_target, gain, c) |
| Integral (deadbeat for G = 1 and a constant load) update of a mean source s holding a fluid-mean quantity y at y_target: s += (G/dt) c (y_target - 2y^n + y^(n-1)), c the source-to-y capacity. y_old carries y^(n-1) between steps. | |
| impure subroutine, public | s_update_mean_sources (q_cons_vf, q_t_sf, t_step) |
| Once per step, fluid-cell averages driving the mean sources (sums over fluid cells). Mean pressure gradient: bulk mass flux Q_i = sum(rho u_i dV)/sum(dV), controlled to mean_mflux(i) by -dP/dx; logged to mean_dpdx.dat. Thermostat: mass-averaged temperature T_b = sum(rho T dV)/sum(rho dV), controlled to mean_temp by the heat source with capacity rho c_v (fluid mean); logged to mean_temp.dat with the mixing-cup T_m = sum(rho u_1 T dV)/sum(rho u_1 dV) and the fluid volume. With mean_temp_wall, the controller holds T_m instead and beta solves source total = beta (A1 + beta A2), A1 = sum(rho cp u_1 psi
dV), A2 = sum(lam psi dV), psi = T - T_s, with A1 including the discrete conduction terms of the applied source; beta, A1, A2 are logged too. | |
| subroutine, public | s_compute_synthetic_forces_rhs (q_prim_vf, q_cons_vf, rhs_vf) |
| Compute the synthetic turbulence RHS contribution. | |
| impure subroutine, public | s_finalize_body_forces_module |
| Finalize the body forces module. | |
Variables | |
| logical, dimension(3) | mpg_dir |
| Mean pressure gradient active in this direction. | |
| real(wp), dimension(3) | mflux_old |
| Previous-step bulk mass flux, for the controller. | |
| integer | mpg_unit |
| mean_dpdx.dat history file unit | |
| logical | mts_on |
| Mean gas heat source (thermostat) active. | |
| real(wp) | temp_old |
| Previous-step bulk temperature, for the controller. | |
| logical | mts_sim |
| Self-similar thermostat (mean_temp_wall set). | |
| real(wp) | mts_beta |
| Its streamwise decay rate beta [1/m]. | |
| integer | mts_unit |
| mean_temp.dat history file unit | |
| logical | mts_warned = .false. |
| The beta quadratic had no real root (reported once). | |
| integer, parameter | spbf_num_freq = 8 |
| real(wp) | spbf_amp |
| real(wp) | spbf_xc |
| real(wp) | spbf_yc |
| real(wp) | spbf_conv_vel |
| real(wp) | spbf_sigma |
| real(wp), dimension(:), allocatable | freq |
| real(wp), dimension(:), allocatable | phase |
| real(wp), dimension(:,:,:), allocatable | rhom |
| real(wp), dimension(:,:,:), allocatable | mts_g1 |
| Self-similar source terms of each cell (s_compute_mts_terms). | |
| real(wp), dimension(:,:,:), allocatable | mts_g2 |
| integer | num_synthetic_wave_numbers |
| real(wp), dimension(:), allocatable | synthetic_k_x |
| real(wp), dimension(:), allocatable | synthetic_k_y |
| real(wp), dimension(:), allocatable | synthetic_k_z |
| real(wp), dimension(:), allocatable | synthetic_phase |
| real(wp), dimension(:), allocatable | synthetic_amp |
| real(wp), dimension(:), allocatable | synthetic_ex |
| real(wp), dimension(:), allocatable | synthetic_ey |
| real(wp), dimension(:), allocatable | synthetic_ez |
Computes gravitational and body force source terms for the momentum equations.
|
private |
Volume of the fluid in cell (j, k, l): zero inside an immersed boundary.
Definition at line 499 of file m_body_forces.fpp.f90.
|
private |
True for a cell outside every immersed boundary.
| [in] | marks | ib_markers, passed so the device routine reads the present copy |
Definition at line 470 of file m_body_forces.fpp.f90.
| subroutine, public m_body_forces::s_apply_bodyforces | ( | type(scalar_field), dimension(1:sys_size), intent(inout) | q_cons_vf, |
| type(scalar_field), dimension(1:sys_size), intent(in) | q_prim_vf_in, | ||
| type(scalar_field), dimension(1:sys_size), intent(inout) | rhs_vf_in, | ||
| real(wp), intent(in) | ldt, | ||
| type(scalar_field), intent(in), optional | q_t_sf ) |
Apply the body forces source term at each Runge-Kutta stage.
| [in] | ldt | local dt |
| [in] | q_t_sf | absent in the AMR fine advance (mean_temp: no amr) |
Definition at line 2005 of file m_body_forces.fpp.f90.
| subroutine, public m_body_forces::s_apply_synthetic_turbulence_force | ( | type(scalar_field), dimension(1:sys_size), intent(inout) | q_cons_vf, |
| type(scalar_field), dimension(1:sys_size), intent(in) | q_prim_vf_in, | ||
| type(scalar_field), dimension(1:sys_size), intent(inout) | rhs_vf_in, | ||
| real(wp), intent(in) | ldt ) |
Adds the synthetic turbulence forcing to the momentum and energy over the stage's local dt.
| [in] | ldt | local dt |
Definition at line 2066 of file m_body_forces.fpp.f90.
|
private |
Compute the acceleration at time t.
Definition at line 1340 of file m_body_forces.fpp.f90.
|
private |
Apply the body force of Wei & Freund (JFM, 2005).
Definition at line 1380 of file m_body_forces.fpp.f90.
| subroutine, public m_body_forces::s_compute_body_forces_rhs | ( | type(scalar_field), dimension(sys_size), intent(in) | q_prim_vf, |
| type(scalar_field), dimension(sys_size), intent(in) | q_cons_vf, | ||
| type(scalar_field), dimension(sys_size), intent(inout) | rhs_vf, | ||
| type(int_bounds_info), dimension(1:3), intent(in) | bounds, | ||
| type(scalar_field), intent(in), optional | q_t_sf ) |
Compute the body force source terms for momentum and energy equations.
Definition at line 1555 of file m_body_forces.fpp.f90.
|
private |
Compute the mixture density at each cell center.
Definition at line 1499 of file m_body_forces.fpp.f90.
|
private |
Source terms of the thermally developed state, psi = T - T_s, central in x: g1 = rho cp u psi - d(lam psi)/dx - lam dpsi/dx, g2 = lam psi, for every cell. The applied source S = beta (g1 + beta g2) and the controller's A1 = sum(g1 dV), A2 = sum(g2 dV) share them.
Definition at line 1909 of file m_body_forces.fpp.f90.
| subroutine, public m_body_forces::s_compute_synthetic_forces_rhs | ( | type(scalar_field), dimension(sys_size), intent(in) | q_prim_vf, |
| type(scalar_field), dimension(sys_size), intent(in) | q_cons_vf, | ||
| type(scalar_field), dimension(sys_size), intent(inout) | rhs_vf ) |
Compute the synthetic turbulence RHS contribution.
Each Fourier mode m has wave vector k_m and a pre-computed solenoidal (divergence-free) direction e_m perpendicular to k_m. The force field is F = rho * (sum_m A_m * cos(k_m.(x-U*t*xhat) + phi_m) * e_m) * (U/Lx) * G. This excites all velocity components correctly and is zero outside the bounding box of the Gaussian window.
Definition at line 2372 of file m_body_forces.fpp.f90.
| impure subroutine, public m_body_forces::s_finalize_body_forces_module |
Finalize the body forces module.
Definition at line 2549 of file m_body_forces.fpp.f90.
|
private |
Initialize a body force with spatial support presented in Wei & Freund (JFM, 2005).
Definition at line 1154 of file m_body_forces.fpp.f90.
| impure subroutine, public m_body_forces::s_initialize_body_forces_module |
Initialize the body forces module. When synthetic_turbulence is enabled, generates random wave vectors for each energy shell on rank 0, then broadcasts to all MPI ranks and copies to GPU.
Definition at line 532 of file m_body_forces.fpp.f90.
|
private |
Integral (deadbeat for G = 1 and a constant load) update of a mean source s holding a fluid-mean quantity y at y_target: s += (G/dt) c (y_target - 2y^n + y^(n-1)), c the source-to-y capacity. y_old carries y^(n-1) between steps.
Definition at line 2142 of file m_body_forces.fpp.f90.
|
private |
Rank 0 opens a per-step history file in case_dir, appending on restart.
Definition at line 2126 of file m_body_forces.fpp.f90.
| impure subroutine, public m_body_forces::s_update_mean_sources | ( | type(scalar_field), dimension(sys_size), intent(in) | q_cons_vf, |
| type(scalar_field), intent(in) | q_t_sf, | ||
| integer, intent(in) | t_step ) |
Once per step, fluid-cell averages driving the mean sources (sums over fluid cells). Mean pressure gradient: bulk mass flux Q_i = sum(rho u_i dV)/sum(dV), controlled to mean_mflux(i) by -dP/dx; logged to mean_dpdx.dat. Thermostat: mass-averaged temperature T_b = sum(rho T dV)/sum(rho dV), controlled to mean_temp by the heat source with capacity rho c_v (fluid mean); logged to mean_temp.dat with the mixing-cup T_m = sum(rho u_1 T dV)/sum(rho u_1 dV) and the fluid volume. With mean_temp_wall, the controller holds T_m instead and beta solves source total = beta (A1 + beta A2), A1 = sum(rho cp u_1 psi dV), A2 = sum(lam psi dV), psi = T - T_s, with A1 including the discrete conduction terms of the applied source; beta, A1, A2 are logged too.
Definition at line 2161 of file m_body_forces.fpp.f90.
|
private |
Definition at line 404 of file m_body_forces.fpp.f90.
|
private |
Previous-step bulk mass flux, for the controller.
Definition at line 390 of file m_body_forces.fpp.f90.
|
private |
Mean pressure gradient active in this direction.
Definition at line 389 of file m_body_forces.fpp.f90.
|
private |
mean_dpdx.dat history file unit
Definition at line 391 of file m_body_forces.fpp.f90.
|
private |
Its streamwise decay rate beta [1/m].
Definition at line 395 of file m_body_forces.fpp.f90.
|
private |
Self-similar source terms of each cell (s_compute_mts_terms).
Definition at line 407 of file m_body_forces.fpp.f90.
|
private |
Definition at line 407 of file m_body_forces.fpp.f90.
|
private |
Mean gas heat source (thermostat) active.
Definition at line 392 of file m_body_forces.fpp.f90.
|
private |
Self-similar thermostat (mean_temp_wall set).
Definition at line 394 of file m_body_forces.fpp.f90.
|
private |
mean_temp.dat history file unit
Definition at line 396 of file m_body_forces.fpp.f90.
|
private |
The beta quadratic had no real root (reported once).
Definition at line 397 of file m_body_forces.fpp.f90.
|
private |
Definition at line 421 of file m_body_forces.fpp.f90.
|
private |
Definition at line 404 of file m_body_forces.fpp.f90.
|
private |
Definition at line 405 of file m_body_forces.fpp.f90.
|
private |
Definition at line 399 of file m_body_forces.fpp.f90.
|
private |
Definition at line 402 of file m_body_forces.fpp.f90.
|
private |
Definition at line 398 of file m_body_forces.fpp.f90.
|
private |
Definition at line 403 of file m_body_forces.fpp.f90.
|
private |
Definition at line 400 of file m_body_forces.fpp.f90.
|
private |
Definition at line 401 of file m_body_forces.fpp.f90.
|
private |
Definition at line 436 of file m_body_forces.fpp.f90.
|
private |
Definition at line 441 of file m_body_forces.fpp.f90.
|
private |
Definition at line 441 of file m_body_forces.fpp.f90.
|
private |
Definition at line 441 of file m_body_forces.fpp.f90.
|
private |
Definition at line 435 of file m_body_forces.fpp.f90.
|
private |
Definition at line 435 of file m_body_forces.fpp.f90.
|
private |
Definition at line 435 of file m_body_forces.fpp.f90.
|
private |
Definition at line 436 of file m_body_forces.fpp.f90.
|
private |
Previous-step bulk temperature, for the controller.
Definition at line 393 of file m_body_forces.fpp.f90.