/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"
9
10namespace amr_wind::overset_ops {
11
12void iblank_to_mask(const IntField& iblank, IntField& maskf);
13
15 const IntField& iblank, const Field& vof, IntField& maskf);
16
17void prepare_mask_cell_for_mac(FieldRepo& repo);
18
19void revert_mask_cell_after_mac(FieldRepo& repo);
20
21// Populate approximate signed distance function using vof field
22void populate_psi(
23 amrex::MultiFab& mf_psi,
24 const amrex::MultiFab& mf_vof,
25 const amrex::Real i_th,
26 const amrex::Real asdf_tiny);
27
28// Modify a vof field to not have values that barely differ from 0 or 1
29void process_vof(amrex::MultiFab& mf_vof, const amrex::Real vof_tol);
30
31// Combine overset target vof field with current non-overset vof field
32void harmonize_vof(
33 amrex::MultiFab& mf_vof_target,
34 const amrex::MultiFab& mf_vof_original,
35 const amrex::iMultiFab& mf_iblank);
36
37// Populate normal vector with special treatment of overset boundary
39 amrex::MultiFab& mf_normvec,
40 const amrex::MultiFab& mf_vof,
41 const amrex::iMultiFab& mf_iblank);
42
43// Calculate fluxes for reinitialization over entire domain without concern for
44// overset bdy
46 amrex::MultiFab& mf_fx,
47 amrex::MultiFab& mf_fy,
48 amrex::MultiFab& mf_fz,
49 const amrex::MultiFab& mf_vof,
50 const amrex::MultiFab& mf_target_vof,
51 const amrex::MultiFab& mf_norm,
52 const amrex::MultiFab& mf_velocity,
53 const amrex::MultiFab& mf_gp,
54 const amrex::MultiFab& mf_density,
55 const amrex::Real Gamma,
56 const amrex::Real margin,
57 const amrex::Real rho1,
58 const amrex::Real rho2);
59
60// Process reinitialization fluxes - zero non-internal to overset region;
61// also calculate pressure source / sink term as a function of fluxes
63 amrex::MultiFab& mf_fx,
64 amrex::MultiFab& mf_fy,
65 amrex::MultiFab& mf_fz,
66 amrex::MultiFab& mf_psource,
67 const amrex::MultiFab& mf_vof,
68 const amrex::iMultiFab& mf_iblank);
69
71 const amrex::iMultiFab& mf_iblank,
72 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> dx,
73 const amrex::Real pvmax);
74
75// Calculate a type of CFL by measuring how much % VOF is being removed per cell
76amrex::Real calculate_pseudo_dt_flux(
77 const amrex::MultiFab& mf_fx,
78 const amrex::MultiFab& mf_fy,
79 const amrex::MultiFab& mf_fz,
80 const amrex::MultiFab& mf_vof,
81 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& dx,
82 const amrex::Real tol);
83
84// Apply reinitialization fluxes to modify fields
85void apply_fluxes(
86 const amrex::MultiFab& mf_fx,
87 const amrex::MultiFab& mf_fy,
88 const amrex::MultiFab& mf_fz,
89 const amrex::MultiFab& mf_psource,
90 amrex::MultiFab& mf_vof,
91 amrex::MultiFab& mf_dens,
92 amrex::MultiFab& mf_vel,
93 amrex::MultiFab& mf_gp,
94 amrex::MultiFab& mf_pressure,
95 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> dx,
96 const amrex::Real ptfac,
97 const amrex::Real vof_tol);
98
99// Get the size of the smallest VOF flux to quantify convergence
100amrex::Real measure_convergence(
101 amrex::MultiFab& mf_fx, amrex::MultiFab& mf_fy, amrex::MultiFab& mf_fz);
102
103// Set levelset field to another quantity to view in plotfile for debugging
104void equate_field(amrex::MultiFab& mf_dest, const amrex::MultiFab& mf_src);
105
106// Swap pressure gradient values in overset region
107void replace_gradp(
108 amrex::MultiFab& mf_gp,
109 const amrex::MultiFab& mf_gp0,
110 const amrex::iMultiFab& mf_iblank);
111
112// Apply pressure gradient to velocity field
114 amrex::MultiFab& mf_vel,
115 const amrex::MultiFab& mf_density,
116 const amrex::MultiFab& mf_gp,
117 const amrex::Real scaling_factor);
118
119} // namespace amr_wind::overset_ops
120
121#endif
Definition overset_ops_K.H:7
void equate_field(amrex::MultiFab &mf_dest, const amrex::MultiFab &mf_src)
Definition overset_ops_routines.cpp:612
void prepare_mask_cell_for_mac(FieldRepo &repo)
Definition overset_ops_routines.cpp:95
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:480
void iblank_to_mask(const IntField &iblank, IntField &maskf)
Definition overset_ops_routines.cpp:14
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:646
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:349
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:397
amrex::Real measure_convergence(amrex::MultiFab &mf_fx, amrex::MultiFab &mf_fy, amrex::MultiFab &mf_fz)
Definition overset_ops_routines.cpp:570
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:409
void process_vof(amrex::MultiFab &mf_vof, const amrex::Real vof_tol)
Definition overset_ops_routines.cpp:180
void iblank_node_to_mask_vof(const IntField &iblank, const Field &voff, IntField &maskf)
Definition overset_ops_routines.cpp:38
void populate_normal_vector(amrex::MultiFab &mf_normvec, const amrex::MultiFab &mf_vof, const amrex::iMultiFab &mf_iblank)
Definition overset_ops_routines.cpp:214
void replace_gradp(amrex::MultiFab &mf_gp, const amrex::MultiFab &mf_gp0, const amrex::iMultiFab &mf_iblank)
Definition overset_ops_routines.cpp:626
void harmonize_vof(amrex::MultiFab &mf_vof_target, const amrex::MultiFab &mf_vof_original, const amrex::iMultiFab &mf_iblank)
Definition overset_ops_routines.cpp:195
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:164
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:255
void revert_mask_cell_after_mac(FieldRepo &repo)
Definition overset_ops_routines.cpp:151