forked from Exawind/amr-wind
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* make nodal projection consistent with mesh mapping * framework to take in mesh mapping based on user implement mesh mapping model * remove alpha scaling for nodal projection * minor modification to workflow for initializing mesh map * fix field string identifier * Fix where mapping happens in nodal projection. also scale back after nodal projection * make different scaling arrays for cell centers, and nodes. Also change tgv_mol input file to use mesh mapping * introduce mesh mapping to tgv physics * Reorganize mesh mapping call to happen before setting any physics * move mesh mapping manager too CFDSim * fix bug in mesh mapping of tgv * account for mesh mapping while computing time step size * create field methods for mapping mesh to and from mapped spaces * introduce mesh mapping to mac projection * add additional checks for mesh mapping of fields * add comments * incorporate mesh mapping for computation of source term * accomadate mesh mapping in diffusion solve * add comments and general cleanup * Output netcdf file from 3D field * output components separately for paraview read * bug fix * Bug fix in coordinates * Output netcdf files along with plot files * provision for mapping velocity from previous time step * changes for mesh mapping consistency * changing mesh space for computation of convective fluxes * fix bugs in scaling of RHS in presence of mesh mapping * perform mesh mapping for velocity after prediction of face velocities * change name of unmapped dimension to physical dimension * add channel flow scaling * fix bug with channel flow scaling * accommodate mesh mapping in convecting taylor vortex * modify BoussinesqBubble to allow for mesh mapping * fix bug with handling of diffusion term when performing and implicit solve in presence of mesh mapping * comment out writing of netcdf file because this does not work in parallel * refactor velocity solve to account for space-dependent mapping * Laminar Channel set up * mesh mapping metric terms for multi-component diffusion solve * remove obsolete line * fix formatting * change channel flow mesh mapping function * fixes to mesh mapping framework * revert mesh mapping changes to BoussinesqBubble * remove mesh mapping from Taylor Green Vortex * fix bug in channel flow scaling * Introduce non uniform mesh coordinates as a field * add framework to compute error norm for laminar channel flow * fix channel flow analytical solution * fix for loop iterator * fix channel flow analytical solution * scale source term to account for mesh mapping * add mesh mapping regression test cases * remove routine to write mesh mapped file to netcdf * add TODO regarding unclear looping over size of tile boxes * fix bug with source term and add explicit time stepping regression test * introduce mesh mapping metric on cell faces * refactor for a cleaner code * add missing bracket * fix formatting * move to parreduce * fix bug from rebase * remove netcdf leftover * changes to fix compilation on GPUs * add blueprint for gradient computation in physical space * update regression test settings * Revert "add blueprint for gradient computation in physical space" This reverts commit b116e02. * fix unit tests * fix channel flow linear solver * remove left over mesh mapping settings * add missing test * clang-tidy cleanup * remove left over obsolete input * refactor mesh mapping * remove unnecessary comments * reintroduce constant coefficient pathway for projection in absence of mesh mapping * change mesh mapping terminology for more clarity. also change access of mapping variables for cleaner code. * clang-tidy * store detJ in fields to avoid recomputation * refactor laminar channel flow to allow flow in any direction * add documentation * code refactor to minimize for loops when not using mesh mapping * update amrex module * clean up * make variable density go through single-component sigma pathway for nodal projection * clean up all mesh mapping code leaks when turned off * remove left over comments and fix clang-tidy errors Co-authored-by: shashankNREL <[email protected]>
- Loading branch information
1 parent
8374f8e
commit 584df17
Showing
56 changed files
with
2,384 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ target_sources(${amr_wind_lib_name} | |
ScratchField.cpp | ||
ViewField.cpp | ||
MLMGOptions.cpp | ||
MeshMap.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#ifndef MESHMAP_H | ||
#define MESHMAP_H | ||
|
||
#include "amr-wind/core/CollMgr.H" | ||
#include "amr-wind/core/Factory.H" | ||
#include "amr-wind/core/Field.H" | ||
|
||
#include "AMReX_MultiFab.H" | ||
#include "AMReX_Geometry.H" | ||
|
||
namespace amr_wind { | ||
|
||
class CFDSim; | ||
|
||
/** | ||
* \defgroup mesh_map Mesh mapping models | ||
* | ||
* AMR-Wind representation of different mesh mapping models | ||
* | ||
* In AMR-Wind, different mesh mappings are implemented using the MeshMap | ||
* class. | ||
*/ | ||
|
||
/** Abstract representation of different mesh mapping models | ||
* | ||
* This class defines an abstract API that represents the notion of some | ||
* mesh mapping that will be used to scale the mesh. The most common use-case | ||
* for this class is to perform RANS simulations. | ||
*/ | ||
class MeshMap : public Factory<MeshMap> | ||
{ | ||
public: | ||
static const std::string base_identifier() { return "MeshMap"; } | ||
|
||
virtual ~MeshMap() = default; | ||
|
||
//! declare mesh mapping fields | ||
void declare_mapping_fields(const CFDSim&, int); | ||
|
||
//! Construct mesh scaling field | ||
virtual void create_map(int, const amrex::Geometry&) = 0; | ||
|
||
protected: | ||
Field* m_mesh_scale_fac_cc{nullptr}; | ||
Field* m_mesh_scale_fac_nd{nullptr}; | ||
Field* m_mesh_scale_fac_xf{nullptr}; | ||
Field* m_mesh_scale_fac_yf{nullptr}; | ||
Field* m_mesh_scale_fac_zf{nullptr}; | ||
|
||
Field* m_mesh_scale_detJ_cc{nullptr}; | ||
Field* m_mesh_scale_detJ_nd{nullptr}; | ||
Field* m_mesh_scale_detJ_xf{nullptr}; | ||
Field* m_mesh_scale_detJ_yf{nullptr}; | ||
Field* m_mesh_scale_detJ_zf{nullptr}; | ||
|
||
Field* m_non_uniform_coord_cc{nullptr}; | ||
Field* m_non_uniform_coord_nd{nullptr}; | ||
}; | ||
|
||
} // namespace amr_wind | ||
|
||
#endif /* MESHMAP_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include "amr-wind/core/MeshMap.H" | ||
#include "amr-wind/CFDSim.H" | ||
|
||
namespace amr_wind { | ||
|
||
void MeshMap::declare_mapping_fields(const CFDSim& sim, int nghost) | ||
{ | ||
|
||
// declare nodal, cell-centered, and face-centered mesh mapping array | ||
m_mesh_scale_fac_cc = &(sim.repo().declare_cc_field( | ||
"mesh_scaling_factor_cc", AMREX_SPACEDIM, nghost, 1)); | ||
m_mesh_scale_fac_nd = &(sim.repo().declare_nd_field( | ||
"mesh_scaling_factor_nd", AMREX_SPACEDIM, nghost, 1)); | ||
m_mesh_scale_fac_xf = &(sim.repo().declare_xf_field( | ||
"mesh_scaling_factor_xf", AMREX_SPACEDIM, nghost, 1)); | ||
m_mesh_scale_fac_yf = &(sim.repo().declare_yf_field( | ||
"mesh_scaling_factor_yf", AMREX_SPACEDIM, nghost, 1)); | ||
m_mesh_scale_fac_zf = &(sim.repo().declare_zf_field( | ||
"mesh_scaling_factor_zf", AMREX_SPACEDIM, nghost, 1)); | ||
|
||
// declare nodal, cell-centered, and face-centered mesh mapping detJ array | ||
m_mesh_scale_detJ_cc = | ||
&(sim.repo().declare_cc_field("mesh_scaling_detJ_cc", 1, nghost, 1)); | ||
m_mesh_scale_detJ_nd = | ||
&(sim.repo().declare_nd_field("mesh_scaling_detJ_nd", 1, nghost, 1)); | ||
m_mesh_scale_detJ_xf = | ||
&(sim.repo().declare_xf_field("mesh_scaling_detJ_xf", 1, nghost, 1)); | ||
m_mesh_scale_detJ_yf = | ||
&(sim.repo().declare_yf_field("mesh_scaling_detJ_yf", 1, nghost, 1)); | ||
m_mesh_scale_detJ_zf = | ||
&(sim.repo().declare_zf_field("mesh_scaling_detJ_zf", 1, nghost, 1)); | ||
|
||
// declare nodal and cell-centered non-uniform mesh | ||
m_non_uniform_coord_cc = &(sim.repo().declare_cc_field( | ||
"non_uniform_coord_cc", AMREX_SPACEDIM, nghost, 1)); | ||
m_non_uniform_coord_nd = &(sim.repo().declare_nd_field( | ||
"non_uniform_coord_nd", AMREX_SPACEDIM, nghost, 1)); | ||
|
||
// TODO: Create BCNoOP fill patch operators for mesh scaling fields ? | ||
} | ||
|
||
} // namespace amr_wind |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.