-
Notifications
You must be signed in to change notification settings - Fork 269
Restructure code and check inputs. #6925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+175
−93
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
49a512d
Restructure code and check inputs.
bangerth 324ff83
Rename functions that compute something, rather than get something.
bangerth 6b56db6
Document return values when they are pairs.
bangerth 56467ea
Consistently order what functions return.
bangerth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -362,7 +362,7 @@ namespace aspect | |
| }; | ||
| std::vector<struct str_data_OES> data_OES; | ||
| void read_data_OES(); | ||
| double get_OES(double t) const; | ||
| double compute_OES(double t) const; | ||
|
|
||
| /** | ||
| * Solve core energy balance for each time step. | ||
|
|
@@ -376,7 +376,7 @@ namespace aspect | |
| * Gravitational contribution Qg*dR/dt | ||
| * Latent heat Ql*dR/dt | ||
| * So that Q+Qs*dT/dt+Qr+Qg*dR/dt*Ql*dR/dt=0 | ||
| * 3. The light component composition X depends on inner core radius (See function get_X() ), | ||
| * 3. The light component composition X depends on inner core radius (See function compute_X() ), | ||
| * and core solidus may dependent on X as well. | ||
| * This becomes a small nonlinear problem. Directly iterate through the above three equations doesn't | ||
| * converge well. Alternatively we solve the inner core radius using the bisection method. | ||
|
|
@@ -394,42 +394,42 @@ namespace aspect | |
| * Compute the difference between solidus and adiabatic temperature at inner | ||
| * core boundary for a given inner core radius @p r. | ||
| */ | ||
| double get_dT(const double r) const; | ||
| double compute_dT(const double r) const; | ||
|
|
||
| /** | ||
| * Use energy balance to calculate core mantle boundary temperature | ||
| * with a given inner core radius @p r. | ||
| */ | ||
| double get_Tc(const double r) const; | ||
| double compute_Tc(const double r) const; | ||
|
|
||
| /** | ||
| * Get the solidus temperature at inner core boundary | ||
| * with a given inner core radius @p r. | ||
| */ | ||
| double get_Ts(const double r) const; | ||
| double compute_Ts(const double r) const; | ||
|
|
||
| /** | ||
| * Compute the core solidus at a given light element concentration @p X (in wt.%) | ||
| * and pressure @p pressure. | ||
| */ | ||
| double get_solidus(const double X, const double pressure) const; | ||
| double compute_solidus(const double X, const double pressure) const; | ||
|
|
||
| /** | ||
| * Get initial inner core radius with given initial core mantle temperature | ||
| * @p T. | ||
| */ | ||
| double get_initial_Ri(const double T) const; | ||
| double compute_initial_Ri(const double T) const; | ||
|
|
||
| /** | ||
| * Get the light element concentration (in wt.%) in the outer core from given | ||
| * inner core radius @p r. | ||
| */ | ||
| double get_X(const double r) const; | ||
| double compute_X(const double r) const; | ||
|
|
||
| /** | ||
| * Compute the core mass inside a certain radius @p r. | ||
| */ | ||
| double get_mass(const double r) const; | ||
| double compute_mass(const double r) const; | ||
|
|
||
| /** | ||
| * Calculate Sn(B,R), referring to \cite NPB+04 . | ||
|
|
@@ -439,73 +439,94 @@ namespace aspect | |
| /** | ||
| * Calculate density at given radius @p r. | ||
| */ | ||
| double get_rho(const double r) const; | ||
| double compute_rho(const double r) const; | ||
|
|
||
| /** | ||
| * Calculate gravitational acceleration at given radius @p r. | ||
| */ | ||
| double get_g(const double r) const; | ||
| double compute_g(const double r) const; | ||
|
|
||
| /** | ||
| * Calculate the core temperature at given radius @p r and | ||
| * temperature at CMB @p Tc. | ||
| */ | ||
| double get_T(const double Tc, const double r) const; | ||
| double compute_T(const double Tc, const double r) const; | ||
|
|
||
| /** | ||
| * Calculate pressure at given radius @p r | ||
| */ | ||
| double get_pressure(const double r) const; | ||
| double compute_pressure(const double r) const; | ||
|
|
||
| /** | ||
| * Calculate the gravitational potential at given radius @p r | ||
| */ | ||
| double get_gravity_potential(const double r) const; | ||
| double compute_gravity_potential(const double r) const; | ||
|
|
||
| /** | ||
| * Calculate energy (@p Qs) and entropy (@p Es) change rate factor | ||
| * (regarding the core cooling rated Tc/dt) for a given core-mantle boundary (CMB) | ||
| * temperature @p Tc | ||
| * | ||
| * @return A pair of (Qs, Es), i.e., the energy change rate factor first | ||
| * and the entropy change rate factor second. | ||
| */ | ||
| void get_specific_heating(const double Tc, double &Qs, double &Es) const; | ||
| std::pair<double,double> | ||
| compute_specific_heating(const double Tc) const; | ||
|
|
||
| /** | ||
| * Calculate energy (@p Qr) and entropy (@p Er) change rate factor (regarding the | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as above |
||
| * radioactive heating rate H) for a given CMB temperature @p Tc | ||
| * | ||
| * @return A pair of (Qr, Er), i.e., the energy change rate factor first | ||
| * and the entropy change rate factor second. | ||
| */ | ||
| void get_radio_heating(const double Tc, double &Qr, double &Er) const; | ||
| std::pair<double,double> | ||
| compute_radio_heating(const double Tc) const; | ||
|
|
||
| /** | ||
| * Calculate energy (@p Qg) and entropy (@p Eg) change rate factor | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and here and below for the other functions. |
||
| * (regarding the inner core growth rate dR/dt) for a given | ||
| * @p Tc (CMB temperature), @p r (inner core radius), and @p X | ||
| * (light element concentration) | ||
| * | ||
| * @return A pair of (Qg, Eg), i.e., the energy change rate factor first | ||
| * and the entropy change rate factor second. | ||
| */ | ||
| void get_gravity_heating(const double Tc, const double r, const double X, double &Qg, double &Eg) const; | ||
| std::pair<double,double> | ||
| compute_gravity_heating(const double Tc, const double r, const double X) const; | ||
|
|
||
| /** | ||
| * Calculate energy (@p Qk) and entropy (@p Ek) change rate factor | ||
| * (regarding the core cooling rate Tc/dt) for a given @p Tc (CMB temperature) | ||
| * | ||
| * @return A pair of (Qk, Ek), i.e., the energy change rate factor first | ||
| * and the entropy change rate factor second. | ||
| */ | ||
| void get_adiabatic_heating(const double Tc, double &Ek, double &Qk) const; | ||
| std::pair<double,double> | ||
| compute_adiabatic_heating(const double Tc) const; | ||
|
|
||
| /** | ||
| * Calculate energy (@p Ql) and entropy (@p El) change rate factor | ||
| * (regarding the inner core growth rate dR/dt) for a given @p Tc (CMB temperature) | ||
| * and @p r (inner core radius) | ||
| * | ||
| * @return A pair of (Ql, El), i.e., the energy change rate factor first | ||
| * and the entropy change rate factor second. | ||
| */ | ||
| void get_latent_heating(const double Tc, const double r, double &El, double &Ql) const; | ||
| std::pair<double,double> | ||
| compute_latent_heating(const double Tc, const double r) const; | ||
|
|
||
| /** | ||
| * Calculate entropy of heat of solution @p Eh for a given @p Tc (CMB temperature), | ||
| * @p r (inner core radius), and @p X (light element concentration) | ||
| */ | ||
| void get_heat_solution(const double Tc, const double r, const double X, double &Eh) const; | ||
| double | ||
| compute_heat_solution(const double Tc, const double r, const double X) const; | ||
|
|
||
| /** | ||
| * return radiogenic heating rate at the current time | ||
| */ | ||
| double get_radioheating_rate() const; | ||
| double compute_radioheating_rate() const; | ||
|
|
||
| /** | ||
| * Update the data of the core dynamic simulation, the data will be used | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the documentation (which returned value is which?)