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 
195  template <class Archive>
196  void
197  serialize (Archive &ar, const unsigned int version);
198 
202  void
203  save (std::map<std::string, std::string> &status_strings) const override;
204 
208  void
209  load (const std::map<std::string, std::string> &status_strings) override;
210 
211  private:
212 
218 
223 
228 
232  types::boundary_id inner_boundary_id;
233  types::boundary_id outer_boundary_id;
234 
238  double init_dT_dt;
239 
243  double init_dR_dt;
244 
248  double init_dX_dt;
249 
254 
258  double Rc;
259 
263  double X_init;
264 
268  double Delta;
269 
273  double P_CMB;
274 
282  double Tm0;
283  double Tm1;
284  double Tm2;
285  double Theta;
287 
291  bool use_bw11;
292 
293  //Variables for formulation of \cite NPB+04
297  double K0;
298 
302  double Alpha;
303 
307  double Rho_0;
308 
312  double Rho_cen;
313 
317  double Lh;
318 
322  double Rh;
323 
327  double Beta_c;
328 
332  double k_c;
333 
337  double Cp;
338 
343 
347  std::vector<double> heating_rate;
348 
352  std::vector<double> half_life;
353 
357  std::vector<double> initial_concentration;
358 
362  double L;
363  double D;
364 
368  double Mc;
369 
373  unsigned int max_steps;
374 
378  double dTa;
379 
383  std::string name_OES;
385  {
386  double t;
387  double w;
388 
389  template <class Archive>
390  void serialize (Archive &ar, const unsigned int)
391  {
392  ar &t
393  & w;
394  }
395  };
396  std::vector<struct str_data_OES> data_OES;
397  void read_data_OES();
398  double compute_OES(double t) const;
399 
426  internal::SolveTimeStepResult solve_time_step() const;
427 
432  double compute_dT(const double r) const;
433 
438  double compute_Tc(const double r) const;
439 
444  double compute_Ts(const double r) const;
445 
450  double compute_solidus(const double X, const double pressure) const;
451 
456  double compute_initial_Ri(const double T) const;
457 
462  double compute_X(const double r) const;
463 
467  double compute_mass(const double r) const;
468 
472  double fun_Sn(const double B, const double R, const unsigned int n) const;
473 
477  double compute_rho(const double r) const;
478 
483  double compute_T(const double Tc, const double r) const;
484 
488  double compute_pressure(const double r) const;
489 
493  double compute_gravity_potential(const double r) const;
494 
503  std::pair<double,double>
504  compute_specific_heating(const double Tc) const;
505 
513  std::pair<double,double>
514  compute_radio_heating(const double Tc) const;
515 
525  std::pair<double,double>
526  compute_gravity_heating(const double Tc, const double r, const double X) const;
527 
535  std::pair<double,double>
536  compute_adiabatic_heating(const double Tc) const;
537 
546  std::pair<double,double>
547  compute_latent_heating(const double Tc, const double r) const;
548 
553  double
554  compute_heat_solution(const double Tc, const double r, const double X) const;
555 
559  double compute_radioheating_rate() const;
560 
565  void update_core_data();
566 
567  };
568  }
569 }
570 
571 
572 #endif
std::tuple< double, double, double > SolveTimeStepResult
Definition: dynamic_core.h:101
void serialize(Archive &ar, const unsigned int)
Definition: dynamic_core.h:390
std::vector< struct str_data_OES > data_OES
Definition: dynamic_core.h:396
void declare_parameters(ParameterHandler &prm)
std::vector< double > initial_concentration
Definition: dynamic_core.h:357