Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiphase dev - FY24 Q2 milestone #1096

Merged
merged 28 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3f72f94
new pressure approach available
mbkuhn Oct 13, 2023
6639881
working version of generic pressure sharpening, except for box bounda…
mbkuhn Oct 26, 2023
9435ada
fixing gp ghost cell issues
mbkuhn Oct 27, 2023
75ecac0
giving the right units to the fluxes
mbkuhn Oct 27, 2023
0c7aec4
important external bdy treatment for scratch gp
mbkuhn Oct 27, 2023
38fbe5b
make new pressure sharpening the default
mbkuhn Nov 1, 2023
31e6010
provide more gp ghost cells, update comments
mbkuhn Feb 12, 2024
d1e8a23
removing options no longer being used
mbkuhn Feb 22, 2024
2c5eda5
deprecating vof-specific sharpening
mbkuhn Feb 22, 2024
e94d1a7
changes that I think are important for wave forcing
mbkuhn Feb 23, 2024
9afb244
better but very complicated way of doing levelset2vof for overset
mbkuhn Mar 8, 2024
6a3c528
new approach to fluxes
mbkuhn Mar 8, 2024
e1663d9
enable perturb pressure for overset
mbkuhn Mar 8, 2024
e9a480b
changing ordering of reference pressure treatment for consistency
mbkuhn Mar 8, 2024
0970480
fluxing across overset boundaries, but just in z
mbkuhn Mar 12, 2024
c61bc65
using reduce_factor for these functions doesn't make sense
mbkuhn Mar 13, 2024
b18d338
symmetrical bounds for levelset2vof, new default for better results w…
mbkuhn Mar 26, 2024
964eb8e
potential new pressure coupling method, commented
mbkuhn Mar 28, 2024
7380a54
going back to more vanilla version for milestone push
mbkuhn Apr 1, 2024
044c638
fixing bug from several commits ago: "new approach to fluxes" 6a3c528
mbkuhn Apr 1, 2024
a0f761f
masking the pressure nodes inside "holes" - for solid parts. must tur…
mbkuhn Apr 1, 2024
b633b06
untested method for calculating wavelength
mbkuhn Apr 9, 2024
89607b4
formatting for earlier commit
mbkuhn Apr 9, 2024
f23a3f3
needed && and, not || or
mbkuhn Apr 9, 2024
6e4f185
fixing bugs in stokes waves
mbkuhn Apr 9, 2024
6233f78
commit immersed boundary approach to pressure coupling
mbkuhn Apr 11, 2024
c30754e
ib pressure approach as intended
mbkuhn May 30, 2024
0fa8f11
Bring wave implementation mostly up-to-speed with main
mbkuhn Jun 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions amr-wind/equation_systems/vof/vof_advection.H
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ struct AdvectionOp<VOF, fvm::Godunov>
{
amrex::ParmParse pp_multiphase("VOF");
pp_multiphase.query("remove_debris", m_rm_debris);
pp_multiphase.query("sharpen_acq_field", m_sharpen_acq);
pp_multiphase.query("sharpen_dest_field", m_sharpen_dest);
pp_multiphase.query("replace_masked", m_replace_mask);

// Setup density factor arrays for multiplying velocity flux
Expand All @@ -37,9 +35,7 @@ struct AdvectionOp<VOF, fvm::Godunov>
const FieldState /*unused*/,
const amrex::Real /*unused*/,
const amrex::Real /*unused*/)
{
// Would be best to sharpen old vof and update old density here
}
{}

void operator()(const FieldState /*unused*/, const amrex::Real dt)
{
Expand All @@ -60,19 +56,6 @@ struct AdvectionOp<VOF, fvm::Godunov>
// Working state of vof is nph, to keep others untouched during step
auto& dof_field = fields.field.state(amr_wind::FieldState::NPH);

// Sharpen starting vof field if hybrid solver is being used
if (repo.int_field_exists("iblank_cell") && m_sharpen_acq) {
auto& f_iblank = repo.get_int_field("iblank_cell");
amr_wind::multiphase::sharpen_acquired_vof(
nlevels, f_iblank, dof_old);
}
// Sharpen future vof field if hybrid solver is being used
if (repo.int_field_exists("iblank_cell") && m_sharpen_dest) {
auto& f_iblank = repo.get_int_field("iblank_cell");
amr_wind::multiphase::sharpen_acquired_vof(
nlevels, f_iblank, dof_new);
}

// Initialize as old state values
for (int lev = 0; lev < repo.num_active_levels(); ++lev) {
amrex::MultiFab::Copy(
Expand Down Expand Up @@ -148,8 +131,6 @@ struct AdvectionOp<VOF, fvm::Godunov>
Field& w_mac;
int isweep = 0;
bool m_rm_debris{true};
bool m_sharpen_acq{false};
bool m_sharpen_dest{false};
bool m_replace_mask{true};
// Lagrangian transport is deprecated, only Eulerian is supported
};
Expand Down
38 changes: 0 additions & 38 deletions amr-wind/equation_systems/vof/vof_hybridsolver_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,6 @@

namespace amr_wind::multiphase {

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real sharpen_kernel(
int i,
int j,
int k,
amrex::Array4<amrex::Real const> const& volfrac) noexcept
{
return std::max(
0.0,
std::min(
1.0,
0.5 + (volfrac(i, j, k) < 0.5 ? -1.0 : 1.0) *
std::pow(std::abs(volfrac(i, j, k) - 0.5), 1.0 / 3.0)));
}

static void sharpen_acquired_vof(
const int nlevels, amr_wind::IntField& f_iblank, amr_wind::Field& f_vof)
{
// Sharpen data from nalu-wind (in iblank regions)
for (int lev = 0; lev < nlevels; ++lev) {
auto& iblank = f_iblank(lev);
auto& vof = f_vof(lev);

for (amrex::MFIter mfi(iblank); mfi.isValid(); ++mfi) {
const auto& gbx = mfi.growntilebox();
const amrex::Array4<const int>& native_flag =
iblank.const_array(mfi);
const amrex::Array4<amrex::Real>& volfrac = vof.array(mfi);
amrex::ParallelFor(
gbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
// In iblanked regions, sharpen VOF and limit it
volfrac(i, j, k) = (native_flag(i, j, k) > 0)
? volfrac(i, j, k)
: sharpen_kernel(i, j, k, volfrac);
});
}
}
}

static void replace_masked_vof(
const int nlevels,
amr_wind::IntField& f_iblank,
Expand Down
4 changes: 0 additions & 4 deletions amr-wind/equation_systems/vof/vof_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ struct PostSolveOp<VOF>
m_fields.field.fillpatch(m_sim.time().current_time());
auto& multiphase = m_sim.physics_manager().get<MultiPhase>();
multiphase.set_density_via_vof();
// Do this for old state too if modified by vof sharpening
if (m_sim.repo().int_field_exists("iblank_cell")) {
multiphase.set_density_via_vof(amr_wind::FieldState::Old);
}

// Calculate n+1/2 density
multiphase.set_nph_density();
Expand Down
Loading
Loading