ABLATE Source Documentation  0.12.33
sublimationModel.hpp
1 #ifndef ABLATELIBRARY_SUBLIMATIONMODEL_HPP
2 #define ABLATELIBRARY_SUBLIMATIONMODEL_HPP
3 
4 #include <petsc.h>
5 #include "boundarySolver/boundarySolver.hpp"
6 
7 namespace ablate::boundarySolver::physics::subModels {
8 
10  private:
11  // static name of this model
12  inline const static std::string sublimationModelId = "SublimationModel";
13 
14  public:
18  struct SurfaceState {
20  PetscReal massFlux;
21 
23  PetscReal temperature;
24 
26  PetscReal regressionRate;
27  };
28 
34  virtual bool RequiresUpdate() { return false; };
35 
42 
48  virtual PetscErrorCode Update(PetscInt faceId, PetscReal dt, PetscReal heatFluxToSurface, PetscReal &temperature) { return PETSC_SUCCESS; };
49 
54  virtual PetscErrorCode Compute(PetscInt faceId, PetscReal heatFluxToSurface, SurfaceState &) = 0;
55 
59  ~SublimationModel() override = default;
60 
65  [[nodiscard]] SerializerType Serialize() const override { return io::Serializable::SerializerType::none; }
66 
71  [[nodiscard]] const std::string &GetId() const override { return sublimationModelId; }
72 
79  PetscErrorCode Save(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override { return PETSC_SUCCESS; };
80 
87  PetscErrorCode Restore(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override { return PETSC_SUCCESS; }
88 };
89 } // namespace ablate::boundarySolver::physics::subModels
90 
91 #endif // ABLATELIBRARY_SUBLIMATIONMODEL_HPP
Definition: boundarySolver.hpp:13
virtual PetscErrorCode Compute(PetscInt faceId, PetscReal heatFluxToSurface, SurfaceState &)=0
virtual bool RequiresUpdate()
Definition: sublimationModel.hpp:34
const std::string & GetId() const override
Definition: sublimationModel.hpp:71
virtual PetscErrorCode Update(PetscInt faceId, PetscReal dt, PetscReal heatFluxToSurface, PetscReal &temperature)
Definition: sublimationModel.hpp:48
SerializerType Serialize() const override
Definition: sublimationModel.hpp:65
virtual void Initialize(ablate::boundarySolver::BoundarySolver &bSolver)
Definition: sublimationModel.hpp:41
PetscErrorCode Restore(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override
Definition: sublimationModel.hpp:87
PetscErrorCode Save(PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override
Definition: sublimationModel.hpp:79
Definition: serializable.hpp:13
SerializerType
Definition: serializable.hpp:18
PetscReal massFlux
The resulting mass flux off the surface.
Definition: sublimationModel.hpp:20
PetscReal regressionRate
PetscReal resulting regression rate off the surface.
Definition: sublimationModel.hpp:26
PetscReal temperature
Surface temperature.
Definition: sublimationModel.hpp:23