MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_body_forces.fpp.f90 File Reference

Contains module m_body_forces. More...

Go to the source code of this file.

Modules

module  m_body_forces
 Computes gravitational and body force source terms for the momentum equations.

Functions/Subroutines

pure logical function m_body_forces::f_is_fluid_cell (marks, j, k, l)
 True for a cell outside every immersed boundary.
pure real(wp) function m_body_forces::f_fluid_volume (marks, j, k, l)
 Volume of the fluid in cell (j, k, l): zero inside an immersed boundary.
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.
impure subroutine m_body_forces::s_initialize_body_force_with_spatial_support
 Initialize a body force with spatial support presented in Wei & Freund (JFM, 2005).
subroutine m_body_forces::s_compute_acceleration (t)
 Compute the acceleration at time t.
subroutine m_body_forces::s_compute_body_force_with_spatial_support (t, bounds)
 Apply the body force of Wei & Freund (JFM, 2005).
subroutine m_body_forces::s_compute_mixture_density (q_cons_vf, bounds)
 Compute the mixture density at each cell center.
subroutine, public m_body_forces::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 m_body_forces::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 m_body_forces::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 m_body_forces::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 m_body_forces::s_open_history (unit, fname)
 Rank 0 opens a per-step history file in case_dir, appending on restart.
subroutine m_body_forces::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 m_body_forces::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 m_body_forces::s_compute_synthetic_forces_rhs (q_prim_vf, q_cons_vf, rhs_vf)
 Compute the synthetic turbulence RHS contribution.
impure subroutine, public m_body_forces::s_finalize_body_forces_module
 Finalize the body forces module.

Variables

logical, dimension(3) m_body_forces::mpg_dir
 Mean pressure gradient active in this direction.
real(wp), dimension(3) m_body_forces::mflux_old
 Previous-step bulk mass flux, for the controller.
integer m_body_forces::mpg_unit
 mean_dpdx.dat history file unit
logical m_body_forces::mts_on
 Mean gas heat source (thermostat) active.
real(wp) m_body_forces::temp_old
 Previous-step bulk temperature, for the controller.
logical m_body_forces::mts_sim
 Self-similar thermostat (mean_temp_wall set).
real(wp) m_body_forces::mts_beta
 Its streamwise decay rate beta [1/m].
integer m_body_forces::mts_unit
 mean_temp.dat history file unit
logical m_body_forces::mts_warned = .false.
 The beta quadratic had no real root (reported once).
integer, parameter m_body_forces::spbf_num_freq = 8
real(wp) m_body_forces::spbf_amp
real(wp) m_body_forces::spbf_xc
real(wp) m_body_forces::spbf_yc
real(wp) m_body_forces::spbf_conv_vel
real(wp) m_body_forces::spbf_sigma
real(wp), dimension(:), allocatable m_body_forces::freq
real(wp), dimension(:), allocatable m_body_forces::phase
real(wp), dimension(:,:,:), allocatable m_body_forces::rhom
real(wp), dimension(:,:,:), allocatable m_body_forces::mts_g1
 Self-similar source terms of each cell (s_compute_mts_terms).
real(wp), dimension(:,:,:), allocatable m_body_forces::mts_g2
integer m_body_forces::num_synthetic_wave_numbers
real(wp), dimension(:), allocatable m_body_forces::synthetic_k_x
real(wp), dimension(:), allocatable m_body_forces::synthetic_k_y
real(wp), dimension(:), allocatable m_body_forces::synthetic_k_z
real(wp), dimension(:), allocatable m_body_forces::synthetic_phase
real(wp), dimension(:), allocatable m_body_forces::synthetic_amp
real(wp), dimension(:), allocatable m_body_forces::synthetic_ex
real(wp), dimension(:), allocatable m_body_forces::synthetic_ey
real(wp), dimension(:), allocatable m_body_forces::synthetic_ez

Detailed Description

Contains module m_body_forces.

Definition in file m_body_forces.fpp.f90.