/home/runner/work/amr-wind/amr-wind/amr-wind/overset/overset_ops_routines.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/overset/overset_ops_routines.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
overset_ops_routines.H
Go to the documentation of this file.
1#ifndef OVERSET_OPS_ROUTINES_H_
2#define OVERSET_OPS_ROUTINES_H_
3
4#include "AMReX_iMultiFab.H"
5#include "AMReX_MultiFab.H"
8
9namespace amr_wind::overset_ops {
10
11// Populate approximate signed distance function using vof field
12void populate_psi(
13 amrex::MultiFab& mf_psi,
14 const amrex::MultiFab& mf_vof,
15 const amrex::Real i_th,
16 const amrex::Real asdf_tiny);
17
18// Modify a vof field to not have values that barely differ from 0 or 1
19void process_vof(amrex::MultiFab& mf_vof, const amrex::Real vof_tol);
20
21// Combine overset target vof field with current non-overset vof field
22void harmonize_vof(
23 amrex::MultiFab& mf_vof_target,
24 const amrex::MultiFab& mf_vof_original,
25 const amrex::iMultiFab& mf_iblank);
26
27// Populate normal vector with special treatment of overset boundary
29 amrex::MultiFab& mf_normvec,
30 const amrex::MultiFab& mf_vof,
31 const amrex::iMultiFab& mf_iblank);
32
33// Calculate fluxes for reinitialization over entire domain without concern for
34// overset bdy
36 amrex::MultiFab& mf_fx,
37 amrex::MultiFab& mf_fy,
38 amrex::MultiFab& mf_fz,
39 const amrex::MultiFab& mf_vof,
40 const amrex::MultiFab& mf_target_vof,
41 const amrex::MultiFab& mf_norm,
42 const amrex::MultiFab& mf_velocity,
43 const amrex::MultiFab& mf_gp,
44 const amrex::MultiFab& mf_density,
45 const amrex::Real Gamma,
46 const amrex::Real margin,
47 const amrex::Real rho1,
48 const amrex::Real rho2);
49
50// Process reinitialization fluxes - zero non-internal to overset region;
51// also calculate pressure source / sink term as a function of fluxes
53 amrex::MultiFab& mf_fx,
54 amrex::MultiFab& mf_fy,
55 amrex::MultiFab& mf_fz,
56 amrex::MultiFab& mf_psource,
57 const amrex::MultiFab& mf_vof,
58 const amrex::iMultiFab& mf_iblank);
59
61 const amrex::iMultiFab& mf_iblank,
62 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> dx,
63 const amrex::Real pvmax);
64
65// Calculate a type of CFL by measuring how much % VOF is being removed per cell
66amrex::Real calculate_pseudo_dt_flux(
67 const amrex::MultiFab& mf_fx,
68 const amrex::MultiFab& mf_fy,
69 const amrex::MultiFab& mf_fz,
70 const amrex::MultiFab& mf_vof,
71 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& dx,
72 const amrex::Real tol);
73
74// Apply reinitialization fluxes to modify fields
75void apply_fluxes(
76 const amrex::MultiFab& mf_fx,
77 const amrex::MultiFab& mf_fy,
78 const amrex::MultiFab& mf_fz,
79 const amrex::MultiFab& mf_psource,
80 amrex::MultiFab& mf_vof,
81 amrex::MultiFab& mf_dens,
82 amrex::MultiFab& mf_vel,
83 amrex::MultiFab& mf_gp,
84 amrex::MultiFab& mf_pressure,
85 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> dx,
86 const amrex::Real ptfac,
87 const amrex::Real vof_tol);
88
89// Get the size of the smallest VOF flux to quantify convergence
90amrex::Real measure_convergence(
91 amrex::MultiFab& mf_fx, amrex::MultiFab& mf_fy, amrex::MultiFab& mf_fz);
92
93// Set levelset field to another quantity to view in plotfile for debugging
94void equate_field(amrex::MultiFab& mf_dest, const amrex::MultiFab& mf_src);
95
96// Replace pressure gradient with hydrostatic field in overset regions
98 amrex::MultiFab& mf_gp,
99 const amrex::MultiFab& mf_density,
100 const amrex::MultiFab& mf_refdens,
101 const amrex::iMultiFab& mf_iblank,
102 const amrex::Real grav_z,
103 const bool is_pptb);
104
105// Swap pressure gradient values in overset region
106void replace_gradp(
107 amrex::MultiFab& mf_gp,
108 const amrex::MultiFab& mf_gp0,
109 const amrex::iMultiFab& mf_iblank);
110
111// Apply pressure gradient to velocity field
113 amrex::MultiFab& mf_vel,
114 const amrex::MultiFab& mf_density,
115 const amrex::MultiFab& mf_gp,
116 const amrex::Real scaling_factor);
117
118} // namespace amr_wind::overset_ops
119
120#endif
Definition overset_ops_K.H:7
void equate_field(amrex::MultiFab &mf_dest, const amrex::MultiFab &mf_src)
Definition overset_ops_routines.cpp:453
void apply_fluxes(const amrex::MultiFab &mf_fx, const amrex::MultiFab &mf_fy, const amrex::MultiFab &mf_fz, const amrex::MultiFab &mf_psource, amrex::MultiFab &mf_vof, amrex::MultiFab &mf_dens, amrex::MultiFab &mf_vel, amrex::MultiFab &mf_gp, amrex::MultiFab &mf_pressure, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dx, const amrex::Real ptfac, const amrex::Real vof_tol)
Definition overset_ops_routines.cpp:321
void apply_pressure_gradient(amrex::MultiFab &mf_vel, const amrex::MultiFab &mf_density, const amrex::MultiFab &mf_gp, const amrex::Real scaling_factor)
Definition overset_ops_routines.cpp:514
void process_fluxes_calc_src(amrex::MultiFab &mf_fx, amrex::MultiFab &mf_fy, amrex::MultiFab &mf_fz, amrex::MultiFab &mf_psource, const amrex::MultiFab &mf_vof, const amrex::iMultiFab &mf_iblank)
Definition overset_ops_routines.cpp:190
amrex::Real calculate_pseudo_velocity_scale(const amrex::iMultiFab &mf_iblank, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dx, const amrex::Real pvmax)
Definition overset_ops_routines.cpp:238
void replace_gradp_hydrostatic(amrex::MultiFab &mf_gp, const amrex::MultiFab &mf_density, const amrex::MultiFab &mf_refdens, const amrex::iMultiFab &mf_iblank, const amrex::Real grav_z, const bool is_pptb)
Definition overset_ops_routines.cpp:467
amrex::Real measure_convergence(amrex::MultiFab &mf_fx, amrex::MultiFab &mf_fy, amrex::MultiFab &mf_fz)
Definition overset_ops_routines.cpp:411
amrex::Real calculate_pseudo_dt_flux(const amrex::MultiFab &mf_fx, const amrex::MultiFab &mf_fy, const amrex::MultiFab &mf_fz, const amrex::MultiFab &mf_vof, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dx, const amrex::Real tol)
Definition overset_ops_routines.cpp:250
void process_vof(amrex::MultiFab &mf_vof, const amrex::Real vof_tol)
Definition overset_ops_routines.cpp:21
void populate_normal_vector(amrex::MultiFab &mf_normvec, const amrex::MultiFab &mf_vof, const amrex::iMultiFab &mf_iblank)
Definition overset_ops_routines.cpp:55
void replace_gradp(amrex::MultiFab &mf_gp, const amrex::MultiFab &mf_gp0, const amrex::iMultiFab &mf_iblank)
Definition overset_ops_routines.cpp:494
void harmonize_vof(amrex::MultiFab &mf_vof_target, const amrex::MultiFab &mf_vof_original, const amrex::iMultiFab &mf_iblank)
Definition overset_ops_routines.cpp:36
void populate_psi(amrex::MultiFab &mf_psi, const amrex::MultiFab &mf_vof, const amrex::Real i_th, const amrex::Real asdf_tiny)
Definition overset_ops_routines.cpp:5
void populate_sharpen_fluxes(amrex::MultiFab &mf_fx, amrex::MultiFab &mf_fy, amrex::MultiFab &mf_fz, const amrex::MultiFab &mf_vof, const amrex::MultiFab &mf_target_vof, const amrex::MultiFab &mf_norm, const amrex::MultiFab &mf_velocity, const amrex::MultiFab &mf_gp, const amrex::MultiFab &mf_density, const amrex::Real Gamma, const amrex::Real margin, const amrex::Real rho1, const amrex::Real rho2)
Definition overset_ops_routines.cpp:96