1 #ifndef ABLATELIBRARY_EVTRANSPORT_HPP
2 #define ABLATELIBRARY_EVTRANSPORT_HPP
4 #include <eos/transport/transportModel.hpp>
5 #include "eos/transport/transportModel.hpp"
6 #include "finiteVolume/fluxCalculator/fluxCalculator.hpp"
7 #include "flowProcess.hpp"
9 namespace ablate::finiteVolume::processes {
18 const std::shared_ptr<fluxCalculator::FluxCalculator> fluxCalculator;
19 const std::shared_ptr<eos::EOS> eos;
20 const std::shared_ptr<eos::transport::TransportModel> transportModel;
23 struct AdvectionData {
34 ablate::finiteVolume::fluxCalculator::FluxCalculatorFunction fluxCalculatorFunction;
35 void* fluxCalculatorCtx;
38 struct DiffusionData {
46 std::vector<PetscReal> evDiffusionCoefficient;
50 std::vector<AdvectionData> advectionDatas;
51 std::vector<DiffusionData> diffusionDatas;
52 std::vector<PetscInt> numberEVs;
55 explicit EVTransport(std::shared_ptr<eos::EOS> eos, std::shared_ptr<fluxCalculator::FluxCalculator> fluxCalcIn = {}, std::shared_ptr<eos::transport::TransportModel> transportModel = {});
84 static PetscErrorCode
UpdateEVField(PetscReal time, PetscInt dim,
const PetscFVCellGeom* cellGeom,
const PetscInt uOff[],
const PetscScalar* conservedValues,
const PetscInt* aOff,
85 PetscScalar* auxField,
void* ctx);
90 static PetscErrorCode
UpdateBoundEVField(PetscReal time, PetscInt dim,
const PetscFVCellGeom* cellGeom,
const PetscInt uOff[],
const PetscScalar* conservedValues,
const PetscInt* aOff,
91 PetscScalar* auxField,
void* ctx);
96 static PetscErrorCode
UpdateMinusOneToOneBoundEVField(PetscReal time, PetscInt dim,
const PetscFVCellGeom* cellGeom,
const PetscInt uOff[],
const PetscScalar* conservedValues,
97 const PetscInt* aOff, PetscScalar* auxField,
void* ctx);
102 static PetscErrorCode
UpdatePositiveEVField(PetscReal time, PetscInt dim,
const PetscFVCellGeom* cellGeom,
const PetscInt uOff[],
const PetscScalar* conservedValues,
const PetscInt* aOff,
103 PetscScalar* auxField,
void* ctx);
114 static PetscErrorCode DiffusionEVFlux(PetscInt dim,
const PetscFVFaceGeom* fg,
const PetscInt uOff[],
const PetscInt uOff_x[],
const PetscScalar field[],
const PetscScalar grad[],
115 const PetscInt aOff[],
const PetscInt aOff_x[],
const PetscScalar aux[],
const PetscScalar gradAux[], PetscScalar flux[],
void* ctx);
125 static PetscErrorCode DiffusionEVFluxVariableDiffusionCoefficient(PetscInt dim,
const PetscFVFaceGeom* fg,
const PetscInt uOff[],
const PetscInt uOff_x[],
const PetscScalar field[],
126 const PetscScalar grad[],
const PetscInt aOff[],
const PetscInt aOff_x[],
const PetscScalar aux[],
const PetscScalar gradAux[],
127 PetscScalar flux[],
void* ctx);
135 static PetscErrorCode AdvectionFlux(PetscInt dim,
const PetscFVFaceGeom* fg,
const PetscInt uOff[],
const PetscScalar fieldL[],
const PetscScalar fieldR[],
const PetscInt aOff[],
136 const PetscScalar auxL[],
const PetscScalar auxR[], PetscScalar* flux,
void* ctx);
Definition: finiteVolumeSolver.hpp:28
Definition: evTransport.hpp:16
static PetscErrorCode UpdatePositiveEVField(PetscReal time, PetscInt dim, const PetscFVCellGeom *cellGeom, const PetscInt uOff[], const PetscScalar *conservedValues, const PetscInt *aOff, PetscScalar *auxField, void *ctx)
Definition: evTransport.cpp:125
static void PositiveExtraVariables(TS ts, ablate::solver::Solver &solver, const std::string &field)
Definition: evTransport.cpp:355
static PetscErrorCode UpdateEVField(PetscReal time, PetscInt dim, const PetscFVCellGeom *cellGeom, const PetscInt uOff[], const PetscScalar *conservedValues, const PetscInt *aOff, PetscScalar *auxField, void *ctx)
Definition: evTransport.cpp:83
static void BoundExtraVariablesMinusOneToOne(TS ts, ablate::solver::Solver &solver, const std::string &field)
Definition: evTransport.cpp:319
static PetscErrorCode UpdateBoundEVField(PetscReal time, PetscInt dim, const PetscFVCellGeom *cellGeom, const PetscInt uOff[], const PetscScalar *conservedValues, const PetscInt *aOff, PetscScalar *auxField, void *ctx)
Definition: evTransport.cpp:97
void Setup(ablate::finiteVolume::FiniteVolumeSolver &flow) override
Definition: evTransport.cpp:9
static void BoundExtraVariables(TS ts, ablate::solver::Solver &solver, const std::string &field)
Definition: evTransport.cpp:284
static PetscErrorCode UpdateMinusOneToOneBoundEVField(PetscReal time, PetscInt dim, const PetscFVCellGeom *cellGeom, const PetscInt uOff[], const PetscScalar *conservedValues, const PetscInt *aOff, PetscScalar *auxField, void *ctx)
Definition: evTransport.cpp:111
Definition: flowProcess.hpp:8
Definition: solver.hpp:17