|
OpenImpala
Image-based parallel transport property solver
|
Solves the cell problem ∇_ξ ⋅ (D ∇_ξ χ_k) = -∇_ξ ⋅ (D ê_k) for a corrector function χ_k. More...
#include <EffectiveDiffusivityHypre.H>
Public Types | |
| using | SolverType = OpenImpala::SolverType |
| Alias for the shared HYPRE solver type enum (defined in Tortuosity.H). | |
Public Member Functions | |
| int | buildCellTypeMask (amrex::iMultiFab &mf_cell_type) const |
| EffectiveDiffusivityHypre (const amrex::Geometry &geom, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm, const amrex::iMultiFab &mf_phase_input, const int phase_id, const OpenImpala::Direction dir_of_chi_k, const SolverType solver_type, const std::string &resultspath, int verbose_level=1, bool write_plotfile_flag=false, const std::map< int, amrex::Real > &phase_coeffs={}) | |
| Construct new solver for the effective diffusivity cell problem. | |
| EffectiveDiffusivityHypre (const EffectiveDiffusivityHypre &)=delete | |
| void | generateActiveMask () |
| const amrex::iMultiFab & | getActiveMask () const |
| void | getChiSolution (amrex::MultiFab &chi_field) |
| Retrieves the solved corrector function χ_k. | |
| const amrex::MultiFab & | getDiffCoeff () const |
| void | initializeDiffCoeff () |
| EffectiveDiffusivityHypre & | operator= (const EffectiveDiffusivityHypre &)=delete |
| void | setupMatrixEquation () |
| bool | solve () |
| Solves the cell problem for the configured χ_k. | |
| ~EffectiveDiffusivityHypre () override=default | |
| Destructor. Base class handles HYPRE resource cleanup. | |
| Public Member Functions inherited from OpenImpala::HypreStructSolver | |
| amrex::Real | getFinalRelativeResidualNorm () const |
| bool | getSolverConverged () const |
| int | getSolverIterations () const |
| HypreStructSolver (const HypreStructSolver &)=delete | |
| HypreStructSolver & | operator= (const HypreStructSolver &)=delete |
| virtual | ~HypreStructSolver () |
| Virtual destructor. Cleans up HYPRE resources safely (guards against post-MPI_Finalize). | |
Static Public Member Functions | |
| static amrex::Array< HYPRE_Int, 3 > | hiV (const amrex::Box &b) |
| static amrex::Array< HYPRE_Int, 3 > | loV (const amrex::Box &b) |
| Static Public Member Functions inherited from OpenImpala::HypreStructSolver | |
| static amrex::Array< HYPRE_Int, 3 > | hiV (const amrex::Box &b) |
| Convert AMReX Box upper corner to HYPRE_Int array. | |
| static amrex::Array< HYPRE_Int, 3 > | loV (const amrex::Box &b) |
| Convert AMReX Box lower corner to HYPRE_Int array. | |
Additional Inherited Members | |
| Protected Member Functions inherited from OpenImpala::HypreStructSolver | |
| void | assembleSystem () |
| Assemble HYPRE matrix and vectors after box values have been set. | |
| void | createMatrixAndVectors () |
| Create and initialize HYPRE matrix and vectors (A, b, x). Must be called after setupGrid() and setupStencil(). | |
| HypreStructSolver (const amrex::Geometry &geom, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm, SolverType solvertype, amrex::Real eps, int maxiter, int verbose) | |
| Construct base solver with configuration. Does NOT call any HYPRE functions. | |
| bool | runSolver (PrecondType precond_type=PrecondType::SMG) |
| Run the HYPRE solver specified by m_solvertype. | |
| void | setupGrid (bool periodic=false) |
| Create HYPRE structured grid from AMReX BoxArray. | |
| void | setupStencil () |
| Create 7-point stencil (center + 6 face neighbours). | |
| Protected Attributes inherited from OpenImpala::HypreStructSolver | |
| HYPRE_StructMatrix | m_A = nullptr |
| HYPRE_StructVector | m_b = nullptr |
| amrex::BoxArray | m_ba |
| bool | m_converged = false |
| amrex::DistributionMapping | m_dm |
| amrex::Real | m_eps |
| amrex::Real | m_final_res_norm = std::numeric_limits<amrex::Real>::quiet_NaN() |
| amrex::Geometry | m_geom |
| HYPRE_StructGrid | m_grid = nullptr |
| int | m_maxiter |
| HYPRE_Int | m_num_iterations = -1 |
| const SolverType | m_solvertype |
| HYPRE_StructStencil | m_stencil = nullptr |
| int | m_verbose |
| HYPRE_StructVector | m_x = nullptr |
| Static Protected Attributes inherited from OpenImpala::HypreStructSolver | |
| static constexpr int | STENCIL_SIZE = 7 |
Solves the cell problem ∇_ξ ⋅ (D ∇_ξ χ_k) = -∇_ξ ⋅ (D ê_k) for a corrector function χ_k.
This class uses HYPRE's structured-grid solvers to find the corrector function χ_k for a given direction k (X, Y, or Z). The material phase where D=D_material is identified from the input phase data. The class sets up and solves the PDE with periodic boundary conditions for χ_k and specific Neumann conditions on internal pore-solid interfaces.
The full effective diffusivity tensor D_eff calculation, which requires all three χ_k fields, is intended to be performed outside this class.
Alias for the shared HYPRE solver type enum (defined in Tortuosity.H).
| OpenImpala::EffectiveDiffusivityHypre::EffectiveDiffusivityHypre | ( | const amrex::Geometry & | geom, |
| const amrex::BoxArray & | ba, | ||
| const amrex::DistributionMapping & | dm, | ||
| const amrex::iMultiFab & | mf_phase_input, | ||
| const int | phase_id, | ||
| const OpenImpala::Direction | dir_of_chi_k, | ||
| const SolverType | solver_type, | ||
| const std::string & | resultspath, | ||
| int | verbose_level = 1, | ||
| bool | write_plotfile_flag = false, | ||
| const std::map< int, amrex::Real > & | phase_coeffs = {} ) |
Construct new solver for the effective diffusivity cell problem.
| geom | AMReX Geometry object defining the domain (REV). |
| ba | AMReX BoxArray defining the distribution of grid patches. |
| dm | AMReX DistributionMapping defining processor assignments. |
| mf_phase_input | Input iMultiFab containing phase IDs (expects 1 component, >=1 ghost cell). |
| phase_id | The ID of the phase considered to be the conductive material (where D=D_material, e.g., pores). |
| dir_of_chi_k | The direction 'k' (X, Y, or Z) for which the corrector function χ_k is being solved. This determines the ê_k vector in the RHS of the cell problem. |
| solver_type | Solver type to use (from SolverType enum). |
| resultspath | Path to directory for writing output files (e.g., plotfiles for χ_k). |
| verbose_level | Verbosity level (0=silent, 1=basic, 2+=detailed HYPRE output). Default 1. |
| write_plotfile_flag | If true, write a plotfile of the solved χ_k field. Default false. |
|
overridedefault |
Destructor. Base class handles HYPRE resource cleanup.
|
delete |
| int OpenImpala::EffectiveDiffusivityHypre::buildCellTypeMask | ( | amrex::iMultiFab & | mf_cell_type | ) | const |
| void OpenImpala::EffectiveDiffusivityHypre::generateActiveMask | ( | ) |
|
inline |
| void OpenImpala::EffectiveDiffusivityHypre::getChiSolution | ( | amrex::MultiFab & | chi_field | ) |
Retrieves the solved corrector function χ_k.
This method should be called after solve() has returned true. It copies the solution from the internal HYPRE vector to the provided AMReX MultiFab. The chi_field should be pre-allocated with the same BoxArray, DistributionMapping, 1 component, and desired number of ghost cells (typically 1 for subsequent gradient calculations).
| chi_field | Output MultiFab to store the solved χ_k. |
|
inline |
|
inlinestatic |
| void OpenImpala::EffectiveDiffusivityHypre::initializeDiffCoeff | ( | ) |
|
inlinestatic |
|
delete |
| void OpenImpala::EffectiveDiffusivityHypre::setupMatrixEquation | ( | ) |
| bool OpenImpala::EffectiveDiffusivityHypre::solve | ( | ) |
Solves the cell problem for the configured χ_k.
Sets up and calls the HYPRE solver. The solved χ_k field can be retrieved using getChiSolution().