Alamo
FullFeedback.H
Go to the documentation of this file.
1//
2// This SCP model implements the method described in the following paper
3//
4// .. bibliography::
5// :list: none
6// :filter: False
7//
8// meier2024diffuse
9//
10// This method imitates inheritance :code:`Propellant::Propellant` using static polymorphism
11//
12
13#ifndef MODEL_PROPELLANT_FULLFEEDBACK_H
14#define MODEL_PROPELLANT_FULLFEEDBACK_H
15
16#include "Propellant.H"
17
18namespace Model
19{
20namespace Propellant
21{
23{
24public:
25 static constexpr const char* name = "fullfeedback";
26
27 FullFeedback() = default;
28 FullFeedback(IO::ParmParse &pp, std::string name)
29 {
30 pp_queryclass(name,*this);
31 }
32
33 void set_pressure(const Set::Scalar a_P)
34 {
35 this->Pbar = a_P/Pref;
36
38
40 else zeta_1 = zeta_0;
41
42 // Pressure-dependent post calculation variables
43 k1 = a1 * Pbar + b1 - zeta_1 / zeta;
44 k2 = a2 * Pbar + b2 - zeta_1 / zeta;
45 k3 = 4.0 * log((c1*Pbar*Pbar + a3*Pbar + b3) - k1 / 2.0 - k2 / 2.0);
46
47 return;
48 }
49
50 AMREX_FORCE_INLINE
52 {
53 Set::Scalar qflux = k1 * phi +
54 k2 * (1.0 - phi) +
55 (zeta_1 / zeta) * exp(k3 * phi * (1.0 - phi));
56 Set::Scalar mlocal = (mlocal_ap) * phi + (mlocal_htpb) * (1.0 - phi) + mlocal_comb * phi * (1.0 - phi);
57 Set::Scalar mdota = fabs(mdot);
58 Set::Scalar mbase = tanh(4.0 * mdota / (mlocal));
59
60 return mbase * qflux;
61 }
62
63
64 AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE
66 {
67 return k_ap * phi + k_htpb * (1.0 - phi);
68 }
69
70 AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE
72 {
73 return rho_ap * phi + rho_htpb * (1.0 - phi);
74 }
75
76 AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE
78 {
79 return cp_ap * phi + cp_htpb * (1.0 - phi);
80 }
81
82 AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE
84 {
85 Set::Scalar L = NAN;
86 if (mob_ap == 1) L = m_ap * Pbar * exp(-E_ap / T) * phi;
87 else L = m_ap * exp(-E_ap / T) * phi;
88 L += m_htpb * exp(-E_htpb / T) * (1.0 - phi);
89 if (T <= bound) L = 0.0;
90 return L;
91 }
92
93
94 static void Parse(FullFeedback& value, IO::ParmParse& pp)
95 {
96 // AP/HTPB interface length
97 pp.query_default("phi.zeta", value.zeta, "10.0_um", Unit::Length());
98 // Reference interface length for heat integration
99 pp.query_default("phi.zeta_0", value.zeta_0, "10.0_um", Unit::Length());
100
101 // Constant offset for $\zeta$ adjustment with pressure
102 pp.query_default("phi.zeta_fit_a",value.zeta_fit_a, "45.0_um", Unit::Length());
103 // Scaling factors for $\zeta$ adjustment with pressure
104 pp.query_default("phi.zeta_fit_b",value.zeta_fit_b, "-6.42_um", Unit::Length());
105
106 // Surrogate heat flux model paramater - AP
107 pp_query_required("a1", value.a1, Unit::Less());
108 // Surrogate heat flux model paramater - HTPB
109 pp_query_required("a2", value.a2,Unit::Less());
110 // Surrogate heat flux model paramater - Total
111 pp_query_required("a3", value.a3,Unit::Less());
112 // Surrogate heat flux model paramater - AP
113 pp_query_required("b1", value.b1, Unit::Less());
114 // Surrogate heat flux model paramater - HTPB
115 pp_query_required("b2", value.b2, Unit::Less());
116 // Surrogate heat flux model paramater - Total
117 pp_query_required("b3", value.b3,Unit::Less());
118 // Surrogate heat flux model paramater - Total
119 pp_query_required("c1", value.c1, Unit::Less());
120
121 // Whether to use pressure to determined the reference Zeta
122 pp_query_default("pressure.dependency", value.arrhenius_dependency, true);
123
124 // Reference pressure for pressure nondimensionalization
125 pp_query_default("Pref",value.Pref,"1_MPa",Unit::Pressure());
126
127 // AP volumetric mass flux reference value
128 pp.query_default("mlocal_ap", value.mlocal_ap, "0.0", Unit::Density()/Unit::Time());
129 // combined volumetric mass flux reference value
130 pp_query_default("mlocal_comb", value.mlocal_comb, "0.0", Unit::Density()/Unit::Time());
131 // HTPB volumetric mass flux reference value
132 pp.query_default("mlocal_htpb",value.mlocal_htpb, "5000_kg/m^3/s", Unit::Density()/Unit::Time());
133
134 // Set::Scalar massfraction = 0.8;
135 // value.mlocal_htpb = 685000.0 - 850e3 * massfraction; // Replicating but needs to be revised!
136 // Util::Message(INFO,value.mlocal_htpb);
137
138 // AP Density
139 pp_query_required("rho_ap", value.rho_ap, Unit::Density());
140 // HTPB Density
141 pp_query_required("rho_htpb", value.rho_htpb, Unit::Density());
142 // AP Thermal Conductivity
144 // HTPB Thermal Conductivity
146 // AP Specific Heat
148 //HTPB Specific Heat
150
151 // AP Pre-exponential factor for Arrhenius Law
152 pp_query_required("m_ap", value.m_ap,Unit::Velocity());
153 // HTPB Pre-exponential factor for Arrhenius Law
154 pp_query_required("m_htpb", value.m_htpb,Unit::Velocity());
155 // COMBINED AP Activation Energy, divided by Rg, for Arrhenius Law (has units of temperature)
156 pp_query_required("E_ap", value.E_ap,Unit::Temperature());
157 // COMBINED HTPB Activation Energy, divided by Rg, for Arrhenius Law(has units of temperature)
158 pp_query_required("E_htpb", value.E_htpb,Unit::Temperature());
159 // Whether to include pressure to the arrhenius law [??]n
160 pp_query_default("mob_ap", value.mob_ap,false);
161 // HTPB Activation Energy for Arrhenius Law
162 pp_query_default("bound", value.bound,"0.0", Unit::Temperature());
163 }
164
165 // IO Variables
166 Set::Scalar zeta = NAN, zeta_0 = NAN;
167 Set::Scalar a1 = NAN, a2 = NAN, a3 = NAN;
168 Set::Scalar b1 = NAN, b2 = NAN, b3 = NAN;
170 //Set::Scalar h1 = NAN, h2 = NAN;
173
174 //Thermal properties
175 Set::Scalar k_ap = NAN, k_htpb = NAN;
178
179 // Regression variables
180 int mob_ap = -1;
181 Set::Scalar m_ap = NAN, m_htpb = NAN, m_comb = NAN;
182 Set::Scalar E_ap = NAN, E_htpb = NAN;
185
186 // Calculated variables
190 Set::Scalar k1=NAN, k2=NAN, k3=NAN, k4=NAN;
191};
192
193}
194}
195
196
197
198#endif
199
200
#define pp_query_required(...)
Definition ParmParse.H:101
#define pp_query_default(...)
Definition ParmParse.H:102
#define pp_queryclass(...)
Definition ParmParse.H:109
int query_default(std::string name, T &value, T defaultvalue)
Definition ParmParse.H:293
void set_pressure(const Set::Scalar a_P)
AMREX_FORCE_INLINE Set::Scalar get_qdot(const Set::Scalar mdot, const Set::Scalar phi)
AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE Set::Scalar get_cp(const Set::Scalar phi)
static constexpr const char * name
AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE Set::Scalar get_L(Set::Scalar phi, Set::Scalar T)
AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE Set::Scalar get_rho(const Set::Scalar phi)
FullFeedback(IO::ParmParse &pp, std::string name)
static void Parse(FullFeedback &value, IO::ParmParse &pp)
AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE Set::Scalar get_K(const Set::Scalar phi)
amrex::Real Scalar
Definition Base.H:18
static Unit Density()
Definition Unit.H:208
static Unit Time()
Definition Unit.H:189
static Unit ThermalConductivity()
Definition Unit.H:213
static Unit Temperature()
Definition Unit.H:191
static Unit Pressure()
Definition Unit.H:205
static Unit Velocity()
Definition Unit.H:199
static Unit Length()
Definition Unit.H:188
static Unit SpecificHeatCapacity()
Definition Unit.H:212
static Unit Less()
Definition Unit.H:187