ABLATE Source Documentation  0.12.34
pressureGradientScaling.hpp
1 #ifndef ABLATELIBRARY_PRESSUREGRADIENTSCALING_HPP
2 #define ABLATELIBRARY_PRESSUREGRADIENTSCALING_HPP
3 
4 #include <memory>
5 #include "eos/eos.hpp"
6 #include "finiteVolume/finiteVolumeSolver.hpp"
7 #include "flowProcess.hpp"
8 #include "monitors/logs/log.hpp"
9 
10 namespace ablate::finiteVolume::processes {
18  private:
22  const std::string id = "PressureGradientScaling";
23 
27  const std::shared_ptr<eos::EOS> eos;
28 
32  const PetscReal maxMachAllowed = 0.7;
33 
37  const PetscReal maxAlphaChange = 0.10;
38 
42  const PetscReal maxAlphaAllowed;
43 
47  const PetscReal maxDeltaPressureFac;
48 
52  const PetscReal domainLength;
53 
57  const std::shared_ptr<ablate::monitors::logs::Log> log;
58 
62  PetscReal maxMach = 0.0;
63  PetscReal alpha;
64 
65  public:
66  PressureGradientScaling(std::shared_ptr<eos::EOS> eos, double alphaInit, double domainLength, double maxAlphaAllowed = {}, double maxDeltaPressureFac = {},
67  std::shared_ptr<ablate::monitors::logs::Log> = {});
68 
75  PetscErrorCode UpdatePreconditioner(TS flowTs, ablate::solver::Solver& flow);
76 
82 
83  // Alpha accessor
84  inline const PetscReal& GetAlpha() { return alpha; }
85 
86  // Alpha accessor
87  inline const PetscReal& GetMaxMach() { return maxMach; }
88 
93  const std::string& GetId() const override { return id; }
94 
101  PetscErrorCode Save(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override;
102 
109  PetscErrorCode Restore(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override;
110 };
111 } // namespace ablate::finiteVolume::processes
112 #endif // ABLATELIBRARY_PRESSUREGRADIENTSCALING_HPP
Definition: finiteVolumeSolver.hpp:28
Definition: pressureGradientScaling.hpp:17
const std::string & GetId() const override
Definition: pressureGradientScaling.hpp:93
PetscErrorCode Save(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override
Definition: pressureGradientScaling.cpp:154
void Setup(ablate::finiteVolume::FiniteVolumeSolver &fv) override
Definition: pressureGradientScaling.cpp:144
PetscErrorCode Restore(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override
Definition: pressureGradientScaling.cpp:160
PetscErrorCode UpdatePreconditioner(TS flowTs, ablate::solver::Solver &flow)
Definition: pressureGradientScaling.cpp:16
Definition: serializable.hpp:13
Definition: solver.hpp:17