Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
766b981
starting point with field boundary manager
mbkuhn Mar 27, 2026
3a9ad5e
move existing field boundary operations and fills and correct includes
mbkuhn Mar 27, 2026
9011a6c
rename boundary plane capabilities
mbkuhn Mar 27, 2026
4ea8d3a
rename MPL stuff
mbkuhn Mar 27, 2026
311a877
turn OceanWavesBoundary into an inherited class of FieldBoundary
mbkuhn Mar 27, 2026
c7c48e3
same thing for MPL
mbkuhn Mar 27, 2026
e270a54
same thing for BoundaryPlane
mbkuhn Mar 27, 2026
65f66b8
make field boundaries belong to field boundary manager
mbkuhn Mar 27, 2026
878d4fc
formatting
mbkuhn Mar 27, 2026
503c26d
refer to field boundaries through field boundary manager
mbkuhn Mar 27, 2026
80dae4e
formatting
mbkuhn Mar 27, 2026
4f0d7ce
extracting OceanWavesBoundary references from OceanWaves physics
mbkuhn Mar 30, 2026
dfaa5d2
put appropriate calls in unit test now that boundary is called indepe…
mbkuhn Mar 30, 2026
c09d55c
adjust output string
mbkuhn Mar 30, 2026
532f527
move ERF function along with other boundary fills
mbkuhn Mar 30, 2026
736cbef
no need for activate bool in MPL
mbkuhn Mar 30, 2026
526c35c
similar for boundary planes
mbkuhn Mar 30, 2026
c62a5a7
correct conditional, modify abort statement and new input arguments
mbkuhn Mar 31, 2026
67f41fe
handle old input argument checks through parser only
mbkuhn Mar 31, 2026
65d9347
similar for OceanWaves
mbkuhn Mar 31, 2026
670507d
add calls that are now necessary to unit tests
mbkuhn Mar 31, 2026
65feb6b
correct flawed conditional checking for ocean waves boundary
mbkuhn Mar 31, 2026
2caebc4
improve bool names
mbkuhn Mar 31, 2026
786036d
add abort statement for ocean waves boundary though it will fail befo…
mbkuhn Mar 31, 2026
eaff24f
change ocean waves boundary to use field pointers
mbkuhn Mar 31, 2026
955067d
remove unused class variable
mbkuhn Mar 31, 2026
f816ee8
remove inaccurate comment
mbkuhn Mar 31, 2026
25cbfbf
review from Dave, Copilot
mbkuhn Apr 10, 2026
48cc95a
Merge branch 'main' into abl_bndry_refactor
mbkuhn Apr 10, 2026
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
23 changes: 22 additions & 1 deletion amr-wind/CFDSim.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
#include "amr-wind/core/FieldRepo.H"
#include "amr-wind/equation_systems/PDEBase.H"
#include "amr-wind/core/Physics.H"
#include "amr-wind/boundary_conditions/field_boundary_fill/FieldBoundary.H"
#include "amr-wind/core/MeshMap.H"
#include "amr-wind/helics.H"

#include "amr-wind/wind_energy/ABLReadERFFunction.H"
#include "amr-wind/boundary_conditions/field_boundary_fill/ReadERFFunction.H"
class MultiBlockContainer;

/** AMR-Wind
Expand Down Expand Up @@ -87,6 +88,21 @@ public:
return m_physics_mgr.objects();
}

FieldBoundaryMgr& field_boundary_manager() { return m_field_boundary_mgr; }
const FieldBoundaryMgr& field_boundary_manager() const
{
return m_field_boundary_mgr;
}

FieldBoundaryMgr::TypeVector& field_boundaries()
{
return m_field_boundary_mgr.objects();
}
const FieldBoundaryMgr::TypeVector& field_boundaries() const
{
return m_field_boundary_mgr.objects();
}

transport::TransportModel& transport_model() { return *m_transport; }
const transport::TransportModel& transport_model() const
{
Expand Down Expand Up @@ -131,6 +147,9 @@ public:
//! Instantiate all physics instances based on user inputs
void init_physics();

//! Instantiate all field boundaries based on user inputs
void init_field_boundaries();

//! Activate overset connectivity
void activate_overset();

Expand Down Expand Up @@ -159,6 +178,8 @@ private:

PhysicsMgr m_physics_mgr;

FieldBoundaryMgr m_field_boundary_mgr;

std::unique_ptr<transport::TransportModel> m_transport;

std::unique_ptr<turbulence::TurbulenceModel> m_turbulence;
Expand Down
11 changes: 11 additions & 0 deletions amr-wind/CFDSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ void CFDSim::init_physics()
}
}

void CFDSim::init_field_boundaries()
{
amrex::ParmParse pp("incflo");
amrex::Vector<std::string> fb_names;
pp.queryarr("field_boundaries", fb_names);

for (const auto& fb : fb_names) {
m_field_boundary_mgr.create(fb, *this);
}
}

void CFDSim::activate_overset()
{
amrex::ParmParse pp("overset");
Expand Down
1 change: 1 addition & 0 deletions amr-wind/boundary_conditions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ target_sources(${amr_wind_lib_name}
)

add_subdirectory(wall_models)
add_subdirectory(field_boundary_fill)
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef ABLBOUNDARYPLANE_H
#define ABLBOUNDARYPLANE_H
#ifndef BOUNDARYPLANE_H
#define BOUNDARYPLANE_H

#include <cstdint>
#include "amr-wind/core/Field.H"
#include "amr-wind/CFDSim.H"
#include "amr-wind/utilities/ncutils/nc_interface.H"
#include "amr-wind/utilities/io_utils.H"
#include "amr-wind/wind_energy/ABLReadERFFunction.H"
#include "amr-wind/boundary_conditions/field_boundary_fill/ReadERFFunction.H"
#include "AMReX_Gpu.H"
#include "AMReX_BndryRegister.H"
#include "AMReX_REAL.H"
Expand Down Expand Up @@ -111,23 +111,36 @@ private:
* This class performs the necessary file operations to read and
* write boundary planes.
*
* \sa ABLFillInflow
* \sa PlaneFillInflow
*/
class ABLBoundaryPlane
class BoundaryPlane : public amr_wind::FieldBoundary::Register<BoundaryPlane>
{
static_assert(AMREX_SPACEDIM == 3, "ABL requires 3 dimensional mesh");

public:
explicit ABLBoundaryPlane(CFDSim& /*sim*/);
static std::string identifier() { return "BoundaryPlane"; }

//! Execute initialization actions after mesh has been fully generated
void post_init_actions();
explicit BoundaryPlane(CFDSim& /*sim*/);

void pre_advance_work();
void post_init_actions() override;

void pre_predictor_work();
void pre_advance_work() override;

void post_advance_work();
void post_advance_work() override;

void pre_predictor_work() override;

void set_velocity(
int lev,
amrex::Real time,
const Field& fld,
amrex::MultiFab& mfab,
int dcomp = 0,
int orig_comp = 0) const override;

// Non-inherited public methods

void pre_advance_inner_calls();

void initialize_data();

Expand All @@ -147,7 +160,7 @@ public:
void populate_data(
int /*lev*/,
amrex::Real /*time*/,
Field& /*fld*/,
const Field& /*fld*/,
amrex::MultiFab& /*mfab*/,
int dcomp = 0,
int orig_comp = 0) const;
Expand All @@ -163,8 +176,6 @@ public:
amrex::Gpu::ManagedVector<amrex::Real>& /*buffer*/);
#endif

[[nodiscard]] bool is_initialized() const { return m_is_initialized; }

[[nodiscard]] bool box_intersects_boundary(
const amrex::Box& /*bx*/,
int /*lev*/,
Expand Down Expand Up @@ -252,8 +263,9 @@ private:
//! IO mode
io_mode m_io_mode{io_mode::undefined};

//! Flag indicating if this capability is available
bool m_is_initialized{false};
//! Flag indicating if the simulation is overset -- needed for complicated
//! timing of pre_advance_work
bool m_has_overset{false};

//! controls extents on native bndry output
const int m_in_rad = 1;
Expand All @@ -266,4 +278,4 @@ private:

} // namespace amr_wind

#endif /* ABLBOUNDARYPLANE_H */
#endif /* BOUNDARYPLANE_H */
Loading
Loading