Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
f53803f5
Commit
f53803f5
authored
May 02, 2020
by
Jacob Kegerreis
Browse files
Add Tillotson basalt eos
parent
b525c566
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/equation_of_state/planetary/equation_of_state.h
View file @
f53803f5
...
...
@@ -80,6 +80,10 @@ enum eos_planetary_material_id {
/*! Tillotson water */
eos_planetary_id_Til_water
=
eos_planetary_type_Til
*
eos_planetary_type_factor
+
2
,
/*! Tillotson basalt */
eos_planetary_id_Til_basalt
=
eos_planetary_type_Til
*
eos_planetary_type_factor
+
3
,
/* Hubbard & MacFarlane (1980) Uranus/Neptune */
...
...
@@ -123,7 +127,7 @@ enum eos_planetary_material_id {
* @brief The parameters of the equation of state.
*/
struct
eos_parameters
{
struct
Til_params
Til_iron
,
Til_granite
,
Til_water
;
struct
Til_params
Til_iron
,
Til_granite
,
Til_water
,
Til_basalt
;
struct
HM80_params
HM80_HHe
,
HM80_ice
,
HM80_rock
;
struct
SESAME_params
SESAME_iron
,
SESAME_basalt
,
SESAME_water
,
SS08_water
;
};
...
...
@@ -164,6 +168,11 @@ gas_internal_energy_from_entropy(float density, float entropy,
&
eos
.
Til_water
);
break
;
case
eos_planetary_id_Til_basalt
:
return
Til_internal_energy_from_entropy
(
density
,
entropy
,
&
eos
.
Til_basalt
);
break
;
default:
error
(
"Unknown material ID! mat_id = %d"
,
mat_id
);
return
0
.
f
;
...
...
@@ -265,6 +274,10 @@ __attribute__((always_inline)) INLINE static float gas_pressure_from_entropy(
return
Til_pressure_from_entropy
(
density
,
entropy
,
&
eos
.
Til_water
);
break
;
case
eos_planetary_id_Til_basalt
:
return
Til_pressure_from_entropy
(
density
,
entropy
,
&
eos
.
Til_basalt
);
break
;
default:
error
(
"Unknown material ID! mat_id = %d"
,
mat_id
);
return
0
.
f
;
...
...
@@ -364,6 +377,10 @@ __attribute__((always_inline)) INLINE static float gas_entropy_from_pressure(
return
Til_entropy_from_pressure
(
density
,
P
,
&
eos
.
Til_water
);
break
;
case
eos_planetary_id_Til_basalt
:
return
Til_entropy_from_pressure
(
density
,
P
,
&
eos
.
Til_basalt
);
break
;
default:
error
(
"Unknown material ID! mat_id = %d"
,
mat_id
);
return
0
.
f
;
...
...
@@ -459,6 +476,10 @@ __attribute__((always_inline)) INLINE static float gas_soundspeed_from_entropy(
return
Til_soundspeed_from_entropy
(
density
,
entropy
,
&
eos
.
Til_water
);
break
;
case
eos_planetary_id_Til_basalt
:
return
Til_soundspeed_from_entropy
(
density
,
entropy
,
&
eos
.
Til_basalt
);
break
;
default:
error
(
"Unknown material ID! mat_id = %d"
,
mat_id
);
return
0
.
f
;
...
...
@@ -557,6 +578,10 @@ gas_entropy_from_internal_energy(float density, float u,
return
Til_entropy_from_internal_energy
(
density
,
u
,
&
eos
.
Til_water
);
break
;
case
eos_planetary_id_Til_basalt
:
return
Til_entropy_from_internal_energy
(
density
,
u
,
&
eos
.
Til_basalt
);
break
;
default:
error
(
"Unknown material ID! mat_id = %d"
,
mat_id
);
return
0
.
f
;
...
...
@@ -657,6 +682,10 @@ gas_pressure_from_internal_energy(float density, float u,
return
Til_pressure_from_internal_energy
(
density
,
u
,
&
eos
.
Til_water
);
break
;
case
eos_planetary_id_Til_basalt
:
return
Til_pressure_from_internal_energy
(
density
,
u
,
&
eos
.
Til_basalt
);
break
;
default:
error
(
"Unknown material ID! mat_id = %d"
,
mat_id
);
return
0
.
f
;
...
...
@@ -760,6 +789,10 @@ gas_internal_energy_from_pressure(float density, float P,
return
Til_internal_energy_from_pressure
(
density
,
P
,
&
eos
.
Til_water
);
break
;
case
eos_planetary_id_Til_basalt
:
return
Til_internal_energy_from_pressure
(
density
,
P
,
&
eos
.
Til_basalt
);
break
;
default:
error
(
"Unknown material ID! mat_id = %d"
,
mat_id
);
return
0
.
f
;
...
...
@@ -861,6 +894,11 @@ gas_soundspeed_from_internal_energy(float density, float u,
&
eos
.
Til_water
);
break
;
case
eos_planetary_id_Til_basalt
:
return
Til_soundspeed_from_internal_energy
(
density
,
u
,
&
eos
.
Til_basalt
);
break
;
default:
error
(
"Unknown material ID! mat_id = %d"
,
mat_id
);
return
0
.
f
;
...
...
@@ -962,6 +1000,10 @@ __attribute__((always_inline)) INLINE static float gas_soundspeed_from_pressure(
return
Til_soundspeed_from_pressure
(
density
,
P
,
&
eos
.
Til_water
);
break
;
case
eos_planetary_id_Til_basalt
:
return
Til_soundspeed_from_pressure
(
density
,
P
,
&
eos
.
Til_basalt
);
break
;
default:
error
(
"Unknown material ID! mat_id = %d"
,
mat_id
);
return
0
.
f
;
...
...
@@ -1051,10 +1093,12 @@ __attribute__((always_inline)) INLINE static void eos_init(
set_Til_iron
(
&
e
->
Til_iron
,
eos_planetary_id_Til_iron
);
set_Til_granite
(
&
e
->
Til_granite
,
eos_planetary_id_Til_granite
);
set_Til_water
(
&
e
->
Til_water
,
eos_planetary_id_Til_water
);
set_Til_basalt
(
&
e
->
Til_basalt
,
eos_planetary_id_Til_basalt
);
convert_units_Til
(
&
e
->
Til_iron
,
us
);
convert_units_Til
(
&
e
->
Til_granite
,
us
);
convert_units_Til
(
&
e
->
Til_water
,
us
);
convert_units_Til
(
&
e
->
Til_basalt
,
us
);
}
// Hubbard & MacFarlane (1980)
...
...
src/equation_of_state/planetary/tillotson.h
View file @
f53803f5
...
...
@@ -81,6 +81,23 @@ INLINE static void set_Til_granite(struct Til_params *mat,
mat
->
eta_zero
=
0
.
0
f
;
mat
->
P_min
=
0
.
0
f
;
}
INLINE
static
void
set_Til_basalt
(
struct
Til_params
*
mat
,
enum
eos_planetary_material_id
mat_id
)
{
mat
->
mat_id
=
mat_id
;
mat
->
rho_0
=
2700
.
0
f
;
mat
->
a
=
0
.
5
f
;
mat
->
b
=
1
.
5
f
;
mat
->
A
=
2.67e10
f
;
mat
->
B
=
2.67e10
f
;
mat
->
u_0
=
4.87e8
f
;
mat
->
u_iv
=
4.72e6
f
;
mat
->
u_cv
=
1.82e7
f
;
mat
->
alpha
=
5
.
0
f
;
mat
->
beta
=
5
.
0
f
;
mat
->
eta_min
=
0
.
0
f
;
mat
->
eta_zero
=
0
.
0
f
;
mat
->
P_min
=
0
.
0
f
;
}
INLINE
static
void
set_Til_water
(
struct
Til_params
*
mat
,
enum
eos_planetary_material_id
mat_id
)
{
mat
->
mat_id
=
mat_id
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment