ASPECT
dynamic_core.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2024 by the authors of the ASPECT code.
3 
4  This file is part of ASPECT.
5 
6  ASPECT is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)
9  any later version.
10 
11  ASPECT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with ASPECT; see the file doc/COPYING. If not see
18  <http://www.gnu.org/licenses/>.
19 */
20 
21 
22 
23 #ifndef _aspect_boundary_temperature_dynamic_core_h
24 #define _aspect_boundary_temperature_dynamic_core_h
25 
28 
29 #include <tuple>
30 
31 namespace aspect
32 {
33  namespace BoundaryTemperature
34  {
35 
39  namespace internal
40  {
41  struct CoreData
42  {
48  CoreData ();
49 
54  double Qs,Qr,Qg,Qk,Ql;
55 
63  double Es,Er,Eg,Ek,El,Eh;
64 
71  double Ri,Ti,Xi;
72 
76  double Q,H;
77 
81  double dt;
82 
87  double dR_dt,dT_dt,dX_dt;
88 
92  double Q_OES;
93 
95  };
96 
101  using SolveTimeStepResult = std::tuple<double, double, double>;
102  }
103 
104 
112  template <int dim>
113  class DynamicCore : public Interface<dim>, public aspect::SimulatorAccess<dim>
114  {
115  public:
119  DynamicCore();
120 
125  void
126  update() override;
127 
131  const internal::CoreData &
132  get_core_data() const;
133 
139  bool
140  is_OES_used() const;
141 
152  double
153  boundary_temperature (const types::boundary_id boundary_indicator,
154  const Point<dim> &location) const override;
155 
163  double
164  minimal_temperature (const std::set<types::boundary_id> &fixed_boundary_ids) const override;
165 
173  double
174  maximal_temperature (const std::set<types::boundary_id> &fixed_boundary_ids) const override;
175 
180  static
181  void
182  declare_parameters (ParameterHandler &prm);
183 
188  void
189  parse_parameters (ParameterHandler &prm) override;
190 
191  private:
192 
198 
203 
208 
212  types::boundary_id inner_boundary_id;
213  types::boundary_id outer_boundary_id;
214 
218  double init_dT_dt;
219 
223  double init_dR_dt;
224 
228  double init_dX_dt;
229 
234 
238  double Rc;
239 
243  double X_init;
244 
248  double Delta;
249 
253  double P_CMB;
254 
262  double Tm0;
263  double Tm1;
264  double Tm2;
265  double Theta;
267 
271  bool use_bw11;
272 
273  //Variables for formulation of \cite NPB+04
277  double K0;
278 
282  double Alpha;
283 
287  double Rho_0;
288 
292  double Rho_cen;
293 
297  double Lh;
298 
302  double Rh;
303 
307  double Beta_c;
308 
312  double k_c;
313 
317  double Cp;
318 
323 
327  std::vector<double> heating_rate;
328 
332  std::vector<double> half_life;
333 
337  std::vector<double> initial_concentration;
338 
342  double L;
343  double D;
344 
348  double Mc;
349 
353  unsigned int max_steps;
354 
358  double dTa;
359 
363  std::string name_OES;
365  {
366  double t;
367  double w;
368  };
369  std::vector<struct str_data_OES> data_OES;
370  void read_data_OES();
371  double compute_OES(double t) const;
372 
399  internal::SolveTimeStepResult solve_time_step() const;
400 
405  double compute_dT(const double r) const;
406 
411  double compute_Tc(const double r) const;
412 
417  double compute_Ts(const double r) const;
418 
423  double compute_solidus(const double X, const double pressure) const;
424 
429  double compute_initial_Ri(const double T) const;
430 
435  double compute_X(const double r) const;
436 
440  double compute_mass(const double r) const;
441 
445  double fun_Sn(const double B, const double R, const unsigned int n) const;
446 
450  double compute_rho(const double r) const;
451 
456  double compute_T(const double Tc, const double r) const;
457 
461  double compute_pressure(const double r) const;
462 
466  double compute_gravity_potential(const double r) const;
467 
476  std::pair<double,double>
477  compute_specific_heating(const double Tc) const;
478 
486  std::pair<double,double>
487  compute_radio_heating(const double Tc) const;
488 
498  std::pair<double,double>
499  compute_gravity_heating(const double Tc, const double r, const double X) const;
500 
508  std::pair<double,double>
509  compute_adiabatic_heating(const double Tc) const;
510 
519  std::pair<double,double>
520  compute_latent_heating(const double Tc, const double r) const;
521 
526  double
527  compute_heat_solution(const double Tc, const double r, const double X) const;
528 
532  double compute_radioheating_rate() const;
533 
538  void update_core_data();
539 
540  };
541  }
542 }
543 
544 
545 #endif
std::tuple< double, double, double > SolveTimeStepResult
Definition: dynamic_core.h:101
std::vector< struct str_data_OES > data_OES
Definition: dynamic_core.h:369
void declare_parameters(ParameterHandler &prm)
std::vector< double > initial_concentration
Definition: dynamic_core.h:337