Line data Source code
1 : #ifndef INTEGRATOR_FLAME_H
2 : #define INTEGRATOR_FLAME_H
3 :
4 : #include <limits>
5 :
6 : #include "Integrator/Integrator.H"
7 : #include "BC/BC.H"
8 : #include "IC/IC.H"
9 : #include "Set/Set.H"
10 : #include "Model/Solid/Finite/NeoHookeanPredeformed.H"
11 : #include "IO/ParmParse.H"
12 :
13 : #include "Base/Mechanics.H"
14 :
15 : #include "Model/Propellant/PowerLaw.H"
16 : #include "Model/Propellant/FullFeedback.H"
17 : #include "Model/Propellant/Homogenize.H"
18 :
19 : namespace Integrator
20 : {
21 :
22 : class Flame : virtual public Integrator::Integrator,
23 : virtual public Base::Mechanics<Model::Solid::Finite::NeoHookeanPredeformed>
24 : {
25 :
26 : using model_type = Model::Solid::Finite::NeoHookeanPredeformed;
27 :
28 : public:
29 : static constexpr const char* name = "flame";
30 :
31 : Flame();
32 : Flame(IO::ParmParse& pp);
33 :
34 : static void Forbids(IO::ParmParse& pp);
35 :
36 : static void Parse(Flame& value, IO::ParmParse& pp);
37 :
38 6 : virtual ~Flame()
39 3 : {
40 3 : delete ic_eta;
41 3 : delete ic_phi;
42 3 : delete thermal.ic_temp;
43 3 : delete ic_laser;
44 3 : delete bc_eta;
45 3 : delete bc_temp;
46 6 : }
47 :
48 : protected:
49 : void Initialize(int lev) override;
50 : void TimeStepBegin(Set::Scalar a_time, int a_iter) override;
51 : void TimeStepComplete(Set::Scalar a_time, int a_iter) override;
52 : void Advance(int lev, Set::Scalar time, Set::Scalar dt) override;
53 : void TagCellsForRefinement(int lev, amrex::TagBoxArray& tags, amrex::Real /*time*/, int /*ngrow*/) override;
54 : void Regrid(int lev, Set::Scalar time) override;
55 : void Integrate(int amrlev, Set::Scalar time, int step,
56 : const amrex::MFIter& mfi, const amrex::Box& box) override;
57 : void UpdateModel(int a_step, Set::Scalar a_time) override;
58 :
59 : Set::Field<Set::Scalar> temp_mf;
60 : Set::Field<Set::Scalar> temp_old_mf;
61 : Set::Field<Set::Scalar> temps_mf;
62 :
63 : Set::Field<Set::Scalar> eta_mf;
64 : Set::Field<Set::Scalar> eta_old_mf;
65 : Set::Field<Set::Scalar> eta_0_mf;
66 : Set::Field<Set::Scalar> mdot_mf;
67 :
68 : Set::Field<Set::Scalar> phi_mf;
69 : Set::Field<Set::Scalar> field;
70 : Set::Field<Set::Scalar> alpha_mf;
71 : Set::Field<Set::Scalar> heatflux_mf;
72 :
73 : Set::Field<Set::Scalar> laser_mf;
74 :
75 : BC::BC<Set::Scalar>* bc_temp = nullptr;
76 : BC::BC<Set::Scalar>* bc_eta = nullptr;
77 : IC::IC<Set::Scalar>* ic_phi = nullptr;
78 : IC::IC<Set::Scalar>* ic_laser = nullptr;
79 :
80 : Set::Scalar phi_refinement_criterion = std::numeric_limits<Set::Scalar>::infinity();
81 : Set::Scalar m_refinement_criterion = NAN;
82 : Set::Scalar t_refinement_criterion = NAN;
83 : Set::Scalar t_refinement_restriction = NAN;
84 : Set::Scalar small = NAN;
85 : IC::IC<Set::Scalar>* ic_eta = nullptr;
86 : bool plot_field = true;
87 : int variable_pressure = -1;
88 :
89 : amrex::BoxArray prev_finest_ba;
90 : int prev_finest_level = -1;
91 : int end_initial_refine = 0;
92 :
93 : // Phase field model variables
94 : struct {
95 : Set::Scalar eps = NAN;
96 : Set::Scalar lambda = NAN;
97 : Set::Scalar kappa = NAN;
98 : Set::Scalar w1 = NAN, w12 = NAN, w0 = NAN;
99 : Set::Scalar min_eta = 0.001;
100 : } pf;
101 :
102 : // Thermal transport variables
103 : struct {
104 : bool on = 0;
105 : Set::Scalar hc = NAN;
106 : Set::Scalar Tref = NAN;
107 : Set::Scalar Tfluid = NAN;
108 : Set::Scalar Tcutoff = NAN;
109 : Set::Scalar end_initial_refine_time = NAN;
110 : Set::Field<Set::Scalar> has_exceeded_Tcutoff;
111 : IC::IC<Set::Scalar>* ic_temp = nullptr;
112 : } thermal;
113 :
114 : // Thermoelastic variables
115 : struct {
116 : int on = 0;
117 : Set::Scalar Telastic = NAN;
118 : model_type model_ap, model_htpb;
119 : Set::Scalar traction = NAN;
120 : int phirefinement = -1;
121 : } elastic;
122 :
123 : // Chamber state variables (not inputs)
124 : struct {
125 : // Integrated variables
126 : Set::Scalar volume = 0.0;
127 : Set::Scalar area = 0.0;
128 : Set::Scalar massflux = 0.0;
129 : // Intensive variables
130 : Set::Scalar pressure = NAN;
131 : } chamber;
132 :
133 :
134 : // Propellant model
135 : Model::Propellant::Propellant<
136 : Model::Propellant::PowerLaw,
137 : Model::Propellant::FullFeedback,
138 : Model::Propellant::Homogenize> propellant;
139 : };
140 : }
141 :
142 : #endif
|