OGS
TESReactionAdaptor.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <memory>
14#include <vector>
15
18
19namespace ProcessLib
20{
21namespace TES
22{
23struct TESLocalAssemblerData;
24
26{
27 const double reaction_rate;
28 const double solid_density;
29};
30
32{
33public:
34 virtual bool checkBounds(std::vector<double> const& /*local_x*/,
35 std::vector<double> const& /*local_x_prev_ts*/)
36 {
37 return true; // by default accept everything
38 }
39
40 virtual ReactionRate initReaction(const unsigned int_pt) = 0;
41
42 virtual void preZerothTryAssemble() {}
43 // TODO: remove
44 virtual double getReactionDampingFactor() const { return -1.0; }
45 virtual ~TESFEMReactionAdaptor() = default;
46
47 static std::unique_ptr<TESFEMReactionAdaptor> newInstance(
48 TESLocalAssemblerData const& data);
49};
50
52{
53public:
55
56 bool checkBounds(std::vector<double> const& local_x,
57 std::vector<double> const& local_x_prev_ts) override;
58
59 ReactionRate initReaction(const unsigned int_pt) override
60 {
62 }
63
64 void preZerothTryAssemble() override;
65
66 // TODO: get rid of
67 double getReactionDampingFactor() const override
68 {
70 }
71
72private:
74
78 double estimateAdsorptionEquilibrium(const double p_V0,
79 const double C0) const;
80
82 std::vector<bool> _bounds_violation;
83
85};
86
88{
89public:
90 explicit TESFEMReactionAdaptorInert(TESLocalAssemblerData const& /*data*/);
91
92 ReactionRate initReaction(const unsigned int_pt) override;
93
94private:
96};
97
99{
100public:
102
103 ReactionRate initReaction(const unsigned /*int_pt*/) override;
104
105private:
107};
108
110{
111public:
113
114 ReactionRate initReaction(const unsigned /*int_pt*/) override;
115
116private:
119 Data const& _d;
121
122 std::unique_ptr<MathLib::ODE::ODESolver<1>> _ode_solver;
123
124 static bool odeRhs(const double /*t*/,
127 ydot,
128 React& reaction);
129};
130
131} // namespace TES
132} // namespace ProcessLib
ReactionRate initReaction(const unsigned int_pt) override
ReactionRate initReaction_slowDownUndershootStrategy(const unsigned int_pt)
TESFEMReactionAdaptorAdsorption(TESLocalAssemblerData const &data)
double estimateAdsorptionEquilibrium(const double p_V0, const double C0) const
bool checkBounds(std::vector< double > const &local_x, std::vector< double > const &local_x_prev_ts) override
ReactionRate initReaction(const unsigned) override
static bool odeRhs(const double, MathLib::ODE::MappedConstVector< 1 > const y, MathLib::ODE::MappedVector< 1 > ydot, React &reaction)
TESFEMReactionAdaptorCaOH2(TESLocalAssemblerData const &data)
std::unique_ptr< MathLib::ODE::ODESolver< 1 > > _ode_solver
ReactionRate initReaction(const unsigned int_pt) override
TESFEMReactionAdaptorInert(TESLocalAssemblerData const &)
ReactionRate initReaction(const unsigned) override
TESFEMReactionAdaptorSinusoidal(TESLocalAssemblerData const &data)
virtual bool checkBounds(std::vector< double > const &, std::vector< double > const &)
static std::unique_ptr< TESFEMReactionAdaptor > newInstance(TESLocalAssemblerData const &data)
virtual ReactionRate initReaction(const unsigned int_pt)=0
virtual double getReactionDampingFactor() const
MappedConstMatrix< N, 1 > MappedConstVector
MappedMatrix< N, 1 > MappedVector