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

Vof #111

Open
wants to merge 52 commits into
base: development
Choose a base branch
from
Open

Vof #111

Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1d8aa88
init commit of vof
Jun 20, 2024
35b3fc2
add missing files
Jun 20, 2024
547d70d
use eb to build tracer (#1)
WeiqunZhang Jun 20, 2024
3e693fb
Tecplot: use nfiles (#2)
WeiqunZhang Jun 20, 2024
087aba0
update VolumeOfFluid.H and .cpp
Jun 21, 2024
3a4f232
Merge branch 'development' into vof
asalmgren Jun 21, 2024
1356ac7
Merge branch 'development' into vof
asalmgren Jun 22, 2024
6ee1d1c
VOF module with required format
Jun 22, 2024
39448dd
Merge branch 'vof' of github.com:IFDL-WSU/incflo into vof
Jun 22, 2024
62578c3
vof advection is done w/o BCs
Jul 10, 2024
6b98a14
Merge branch 'development' into vof
Jul 10, 2024
915eb86
implementation of the height function
Jul 26, 2024
b5cd784
curvature calculation is done
Aug 7, 2024
b1f0da5
Merge branch 'AMReX-Fluids:development' into vof
IFDL-WSU Aug 7, 2024
fdc0d62
light modification
Aug 17, 2024
aa39f08
Merge branch 'vof' of github.com:IFDL-WSU/incflo-vof into vof
Aug 17, 2024
f8911d1
light modification
Aug 17, 2024
eabae52
Merge branch 'AMReX-Fluids:development' into vof
IFDL-WSU Aug 17, 2024
4f81fb1
Merge branch 'AMReX-Fluids:development' into vof
IFDL-WSU Aug 19, 2024
303c098
implement surface-tension force
Aug 26, 2024
c8328ef
Merge remote-tracking branch 'hua/vof' into vof
Aug 26, 2024
6c9cba0
update implementation of surface tension force
Sep 6, 2024
16811b2
Merge branch 'AMReX-Fluids:development' into vof
IFDL-WSU Sep 6, 2024
2eb52b8
Merge branch 'AMReX-Fluids:development' into vof
IFDL-WSU Sep 14, 2024
1fc9cde
test
Sep 14, 2024
b403956
Merge branch 'vof' of github.com:IFDL-WSU/incflo-vof into vof
Sep 14, 2024
1789530
implement 2D
Sep 19, 2024
b9df26d
implement 2D
Sep 19, 2024
3274baa
Merge branch 'AMReX-Fluids:development' into vof
IFDL-WSU Sep 19, 2024
5c37b09
update 2D implementation
Sep 20, 2024
3c1db7c
update 2D implementation
Sep 20, 2024
0a57edd
update 2D implementation
Sep 24, 2024
1cbede4
Merge branch 'AMReX-Fluids:development' into vof
IFDL-WSU Sep 25, 2024
c8e1cd3
use cc project and face-centered SF
Oct 1, 2024
3971e64
Merge branch 'AMReX-Fluids:development' into vof
IFDL-WSU Oct 2, 2024
d257a29
did cleaning for tests
Oct 2, 2024
7109fd1
correct lid_drven_cavity input
Oct 2, 2024
cee1737
clean bugs for ccproj based VOF
Oct 4, 2024
1868861
clean bugs for ccproj based VOF
Oct 4, 2024
61e1c73
update for conservative advection scheme
Oct 7, 2024
4fefd68
implement filtering of VOF for high density ratio flows
Oct 12, 2024
b166381
cleaned bugs and complete capillary wave test
Oct 26, 2024
947ffd6
ready for drop flight test
Nov 6, 2024
36353b1
complete merge with incflo development
Nov 7, 2024
4360a93
Merge branch 'AMReX-Fluids-development' into vof
Nov 7, 2024
41cde17
fix the bug of io.cpp caused by VOF implementation
Nov 7, 2024
62d1545
Merge branch 'AMReX-Fluids:development' into vof
IFDL-WSU Dec 4, 2024
3415bfe
update tecplot output
Dec 4, 2024
75a4c63
Implement the initialization of VOF using a parameter incflo.vof_init…
Dec 8, 2024
113cb42
Merge branch 'AMReX-Fluids:development' into vof
IFDL-WSU Dec 8, 2024
8ca85d5
forget to update some files in previous commit
Dec 8, 2024
5bb98cd
update vof.cpp
Dec 8, 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
1 change: 1 addition & 0 deletions src/Make.incflo
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Bdirs += src/projection
Bdirs += src/rheology
Bdirs += src/setup
Bdirs += src/utilities
Bdirs += src/vof

ifeq ($(USE_PARTICLES), TRUE)
DEFINES += -DINCFLO_USE_PARTICLES
Expand Down
18 changes: 18 additions & 0 deletions src/incflo.H
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <DiffusionTensorOp.H>
#include <DiffusionScalarOp.H>
#include <VolumeOfFluid.H>

enum struct StepType {
Predictor, Corrector
Expand All @@ -31,6 +32,7 @@ public:

friend DiffusionTensorOp;
friend DiffusionScalarOp;
friend VolumeOfFluid;

enum struct FluidModel {
Newtonian, powerlaw, Bingham, HerschelBulkley, deSouzaMendesDutra
Expand Down Expand Up @@ -211,6 +213,18 @@ public:
amrex::Vector<amrex::MultiFab const*> const& eta,
amrex::Real dt_diff);

///////////////////////////////////////////////////////////////////////////
//
// tacer advection by VOF method
//
////////////////////////////////////////////////////////////////////////////

void tracer_vof_advection (amrex::Vector<amrex::MultiFab*> const& tracer,
AMREX_D_DECL(amrex::Vector<amrex::MultiFab const*> const& u_mac,
amrex::Vector<amrex::MultiFab const*> const& v_mac,
amrex::Vector<amrex::MultiFab const*> const& w_mac));


[[nodiscard]] amrex::Array<amrex::MultiFab,AMREX_SPACEDIM>
average_scalar_eta_to_faces (int lev, int comp, amrex::MultiFab const& cc_eta) const;

Expand Down Expand Up @@ -675,6 +689,8 @@ private:
std::unique_ptr<DiffusionTensorOp> m_diffusion_tensor_op;
std::unique_ptr<DiffusionScalarOp> m_diffusion_scalar_op;

//vof class pointer
std::unique_ptr<VolumeOfFluid> p_volume_of_fluid;
//
// end of member variables
//
Expand Down Expand Up @@ -755,6 +771,8 @@ private:
DiffusionTensorOp* get_diffusion_tensor_op ();
DiffusionScalarOp* get_diffusion_scalar_op ();

VolumeOfFluid* get_volume_of_fluid ();

amrex::Vector<amrex::MultiFab*> get_velocity_old () noexcept;
amrex::Vector<amrex::MultiFab*> get_velocity_new () noexcept;
amrex::Vector<amrex::MultiFab*> get_velocity_eb () noexcept;
Expand Down
2 changes: 2 additions & 0 deletions src/incflo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ void incflo::Evolve()
if (writeNow())
{
WritePlotFile();
get_volume_of_fluid()->WriteTecPlotFile (m_cur_time,m_nstep);
get_volume_of_fluid()->write_tecplot_surface(m_cur_time,m_nstep);
m_last_plt = m_nstep;
}

Expand Down
6 changes: 6 additions & 0 deletions src/incflo_apply_predictor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,10 @@ void incflo::ApplyPredictor (bool incremental_projection)
AMREX_D_DECL(GetVecOfConstPtrs(u_mac), GetVecOfConstPtrs(v_mac),
GetVecOfConstPtrs(w_mac)));
#endif

// use vof to advect tracer

tracer_vof_advection(get_tracer_new (), AMREX_D_DECL(GetVecOfConstPtrs(u_mac), GetVecOfConstPtrs(v_mac),
GetVecOfConstPtrs(w_mac)));

}
5 changes: 5 additions & 0 deletions src/incflo_regrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ void incflo::MakeNewLevelFromCoarse (int lev,
m_diffusion_tensor_op.reset();
m_diffusion_scalar_op.reset();

p_volume_of_fluid.reset();

// Note: finest_level has not yet been updated and so we use lev
#ifdef AMREX_USE_EB
macproj = std::make_unique<Hydro::MacProjector>(Geom(0,lev),
Expand Down Expand Up @@ -92,6 +94,8 @@ void incflo::RemakeLevel (int lev, Real time, const BoxArray& ba,
m_diffusion_tensor_op.reset();
m_diffusion_scalar_op.reset();

p_volume_of_fluid.reset();

#ifdef AMREX_USE_EB
macproj = std::make_unique<Hydro::MacProjector>(Geom(0,finest_level),
MLMG::Location::FaceCentroid, // Location of mac_vec
Expand All @@ -115,5 +119,6 @@ void incflo::ClearLevel (int lev)
m_factory[lev].reset();
m_diffusion_tensor_op.reset();
m_diffusion_scalar_op.reset();
p_volume_of_fluid.reset();
macproj.reset();
}
9 changes: 9 additions & 0 deletions src/prob/incflo_prob_I.H
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,13 @@
amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> const& dx,
amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> const& problo,
amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> const& probhi) const;

void droplet (amrex::Box const& vbx, amrex::Box const& gbx,
amrex::Array4<amrex::Real> const& vel,
amrex::Array4<amrex::Real> const& density,
amrex::Array4<amrex::Real> const& tracer,
amrex::Box const& domain,
amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> const& dx,
amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> const& problo,
amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> const& probhi);
#endif
7 changes: 7 additions & 0 deletions src/prob/prob_init_fluid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,19 @@ void incflo::prob_init_fluid (int lev)
ld.tracer.array(mfi),
domain, dx, problo, probhi);

}
else if (1109 == m_probtype)
{
}
else
{
amrex::Abort("prob_init_fluid: unknown m_probtype");
};
}

if (1109 == m_probtype) {
tracer_vof_init_fraction(lev, ld.tracer, this);
}
}

void incflo::init_rotating_flow (Box const& vbx, Box const& /*gbx*/,
Expand Down
4 changes: 2 additions & 2 deletions src/utilities/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,6 @@ void incflo::WritePlotFile()

const std::string& plotfilename = amrex::Concatenate(m_plot_file, m_nstep);

amrex::Print() << " Writing plotfile " << plotfilename << " at time " << m_cur_time << std::endl;

int ncomp = 0;

// Velocity components
Expand Down Expand Up @@ -693,3 +691,5 @@ void incflo::WritePlotFile()
particleData.Checkpoint(plotfilename);
#endif
}


8 changes: 8 additions & 0 deletions src/vof/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
target_include_directories(incflo PRIVATE ${CMAKE_CURRENT_LIST_DIR})

target_sources(incflo
PRIVATE
VolumeOfFluid.H
VolumeOfFluid.cpp
incflo_vof.cpp
)
4 changes: 4 additions & 0 deletions src/vof/Make.package
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CEXE_sources += VolumeOfFluid.cpp
CEXE_sources += incflo_vof.cpp
CEXE_headers += VolumeOfFluid.H

36 changes: 36 additions & 0 deletions src/vof/VolumeOfFluid.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//struct TracerVOF {
// GfsVariableTracer parent;
//
// GfsVariable * m[FTT_DIMENSION], * alpha;
//};
// Header file (VolumeOfFluid class)
#ifndef INCFLO_VOF_
#define INCFLO_VOF_
class incflo;

class VolumeOfFluid
{
public:
VolumeOfFluid (incflo* a_incflo);
void tracer_vof_advection(amrex::Vector<amrex::MultiFab*> const& tracer,
AMREX_D_DECL(amrex::Vector<amrex::MultiFab const*> const& u_mac,
amrex::Vector<amrex::MultiFab const*> const& v_mac,
amrex::Vector<amrex::MultiFab const*> const& w_mac),
amrex::Real dt);
void write_tecplot_surface(amrex::Real time, int nstep);
void WriteTecPlotFile (amrex::Real time, int nstep);

// normal vector of interface
amrex::Vector<amrex::MultiFab> normal;
// the plane defined by @m.@x = @alpha
amrex::Vector<amrex::MultiFab> alpha;
private:
incflo* v_incflo; //incflo object
int finest_level;
void tracer_vof_update(amrex::Vector<amrex::MultiFab*> const& tracer);

};

void tracer_vof_init_fraction(int lev, amrex::MultiFab& a_tracer, incflo const* a_incflo);

#endif
Loading