Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
BrokenPowerlawPhaseLagZone.h
Go to the documentation of this file.
1 
9 #ifndef __BROKEN_POWERLAW_PHASE_LAG_ZONE
10 #define __BROKEN_POWERLAW_PHASE_LAG_ZONE
11 
12 #include "../Core/SharedLibraryExportMacros.h"
13 #include "DissipatingZone.h"
14 #include "DissipatingBody.h"
15 #include "BinarySystem.h"
17 #include "LagSpinBreakCondition.h"
18 
19 
20 namespace Evolve {
21 
26  class LIB_PUBLIC BrokenPowerlawPhaseLagZone : virtual public DissipatingZone {
28  friend class LagSpinBreakCondition;
29  private:
30  bool
33 
36  __can_lock;
37 
38  std::vector<double>
40  __tidal_frequency_breaks,
41 
43  __spin_frequency_breaks,
44 
47 
49  __spin_frequency_powers,
50 
55  __break_phase_lags;
56 
57  double
59  __inertial_mode_enhancement,
60 
63 
66  std::vector<double>::size_type __spin_index;
67 
76  std::vector< std::vector<double>::size_type > __tidal_indices;
77 
79  inline std::vector< std::vector<double>::size_type >::size_type
83  int orbital_frequency_multiplier,
84 
87  int spin_frequency_multiplier
88  ) const
89  {
90  return (
91  2
92  +
93  (orbital_frequency_multiplier > 0 ? 1 : -1)
94  *
95  (
96  spin_frequency_multiplier
97  +
98  5 * orbital_frequency_multiplier
99  )
100  );
101  }
102 
104  double get_orbital_frequency(const BinarySystem &system) const;
105 
108  double get_inertial_mode_factor(
110  //inertial mode enhancement is required.
111  double abs_forcing_frequency,
112 
115  int orbital_frequency_multiplier,
116 
119  int spin_frequency_multiplier,
120 
122  //Dissipation::SPIN_FREQUENCY or Dissipation::ORBITAL_FREQUENCY,
123  //return the derivative of the log of the enhancement factor w.r.t.
125  Dissipation::QuantityEntry entry=Dissipation::NO_DERIV
126  ) const;
127 
130  void reset();
131 
138  void set_spin_index();
139 
146  std::vector<double>::size_type get_tidal_index(
148  double abs_forcing_frequency
149  ) const;
150 
153  void add_tidal_frequency_conditions(
155  BinarySystem &system,
156 
158  bool primary,
159 
161  unsigned zone_index,
162 
166  );
167 
169  void print_configuration(std::ostream &out_stream = std::clog);
170 
171  public:
175  : __dissipative(false), __can_lock(false) {}
176 
180  void setup(
183  const std::vector<double> &tidal_frequency_breaks,
184 
187  const std::vector<double> &spin_frequency_breaks,
188 
193  const std::vector<double> &tidal_frequency_powers,
194 
199  const std::vector<double> &spin_frequency_powers,
200 
203  double reference_phase_lag,
204 
207  double inertial_mode_enhancement = 1.0,
208 
217  double inertial_mode_sharpness = 10.0
218  );
219 
221  virtual void configure(
222  bool initialize,
223  double age,
224  double orbital_frequency,
225  double eccentricity,
226  double orbital_angmom,
227  double spin,
228  double inclination,
229  double periapsis,
230  bool spin_is_frequency
231  );
232 
241  virtual double modified_phase_lag(
244  int orbital_frequency_multiplier,
245 
248  int spin_frequency_multiplier,
249 
251  double forcing_frequency,
252 
255  Dissipation::QuantityEntry entry,
256 
260  double &above_lock_value
261  ) const;
262 
265  virtual double love_coefficient(
268  int,
269 
272  int,
273 
276  Dissipation::QuantityEntry
277  ) const
278  {return 0;}
279 
284  virtual CombinedStoppingCondition *stopping_conditions(
286  BinarySystem &system,
287 
289  bool primary,
290 
292  unsigned zone_index
293  );
294 
296  virtual void change_e_order(
298  unsigned new_e_order,
299 
301  BinarySystem &system,
302 
304  bool primary,
305 
307  unsigned zone_index
308  );
309 
311  virtual bool dissipative() const
312  {return __dissipative;}
313 
314  virtual bool can_lock() const
315  {return __can_lock;}
316 
319 #ifndef NDEBUG
320  std::cerr << "Destroying powerlaw lag zone:"
321  << "Tidal breaks:";
322  for(
323  std::vector<double>::const_iterator
324  br_i = __tidal_frequency_breaks.begin();
325  br_i != __tidal_frequency_breaks.end();
326  ++br_i
327  )
328  std::cerr << " " << *br_i;
329  std::cerr << "Spin breaks: ";
330  for(
331  std::vector<double>::const_iterator
332  br_i = __spin_frequency_breaks.begin();
333  br_i != __spin_frequency_breaks.end();
334  ++br_i
335  )
336  std::cerr << " " << *br_i;
337  std::cerr << std::endl;
338 #endif
339  reset();
340  }
341 
342  }; //End BrokenPowerlawPhaseLagZone class.
343 
344 } //End BinarySystem namespace.
345 
346 #endif
std::vector< std::vector< double >::size_type > __tidal_indices
The indices within __tidal_frequency_powers of the powerlaw now in effect for each active tidal term...
Definition: setup.py:1
Declares a class representing one zone of a body dissipative to tidal distortions.
std::vector< double >::size_type __spin_index
The index within __spin_frequency_powers of the powerlaw now in effect.
std::vector< std::vector< double >::size_type >::size_type tidal_term_index(int orbital_frequency_multiplier, int spin_frequency_multiplier) const
The index of the given tidal term within __tidal_indices.
virtual double love_coefficient(int, int, Dissipation::QuantityEntry) const
Should return the corresponding component of the love coefficient (Lai 2012 Equation 24)...
bool __dissipative
Is the zone dissipative.
Orientations of zones of bodies in a binary system.
A layer of a system body for which the tidal bulge is not exactly in phase with the tidal potential...
Declares a stopping condition monitoring for critical spin frequencies.
double modified_phase_lag(const EvolvingStar *star, unsigned zone_index, int orbital_frequency_multiplier, int spin_frequency_multiplier, double forcing_frequency, int entry, double *above_lock_value)
See Evolve::BrokenPowerlawPhaseLagZone::modified_phase_lag for details.
Definition: CInterface.cpp:107
Defines the BinarySystem class.
NO_DERIV
The quantity itself, undifferentiated.
Declares the DissipatingBody class.
A DissipatingZone where the phase lag is described by a broken powerlaw.
BrokenPowerlawPhaseLagZone()
Create a non-dissipative zone. Must call setup() if the zone is dissipative.
Declares a stopping condition satisfied when a forcing frequency reaches a critical value...
std::vector< double > __tidal_frequency_powers
The powerlaw indices for the tidal frequency dependence.
A class combining the the outputs of multiple stopping conditions.
virtual bool dissipative() const
Return true iff disspation has been defined for the zone.
satisfied when a forcing frequency reaches a critical value.
Describes a system of two bodies orbiting each other.
Definition: BinarySystem.h:56
virtual bool can_lock() const
Should return true iff the zone&#39;s dissipation is discontinuous at zero frequency. ...