API Reference
Simulate steadily solidifying three-phase mushy layers in a Hele-Shaw cell.
boundary_conditions
get_boundary_conditions(non_dimensional_params, bottom_variables, top_variables)
Function to return the boundary conditions for scipy solve_BVP.
The returned array is zero when the boundary conditions are satisfied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
non_dimensional_params
|
NonDimensionalParams
|
Non-dimensional parameters |
required |
bottom_variables
|
NDArray
|
Array of the solution variables evaluated at the bottom boundary. |
required |
top_variables
|
NDArray
|
Array of the solution variables evaluated at the top boundary. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
NDArray |
NDArray
|
residual of the boundary conditions |
Source code in mush3p/boundary_conditions.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
model
full
FullModel
Implement the full model equations and provide the ode_fun method to be used by scipy solve_BVP.
The gas fraction is calculated by solving a non-linear equation and is fully coupled to the liquid darcy flux. Solid, liquid and gas fractions sum to one. Gas density is calculated from the ideal gas law.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
NonDimensionalParams
|
Non-dimensional parameters |
required |
height
|
NDArray
|
Height values |
required |
temperature
|
NDArray
|
Temperature values |
required |
temperature_derivative
|
NDArray
|
Temperature derivative values |
required |
dissolved_gas_concentration
|
NDArray
|
Dissolved gas concentration values |
required |
hydrostatic_pressure
|
NDArray
|
Hydrostatic pressure values |
required |
frozen_gas_fraction
|
NDArray
|
Frozen gas fraction |
required |
mushy_layer_depth
|
NDArray
|
Mushy layer depth |
required |
Source code in mush3p/model/full.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |
gas_fraction_derivative: NDArray
property
Numerically approximate the derivative with finite difference.
incompressible
IncompressibleModel
Bases: FullModel
implement equations for the incompressible model.
These are identical to the full model but with the dimensionless gas density set to 1.0.
Source code in mush3p/model/incompressible.py
5 6 7 8 9 10 11 12 13 14 15 | |
instant
The equations for solving the instant nucleation model
All quantities are calculated from the smaller set of variables: temperature temperature_derivative hydrostatic_pressure frozen_gas_fraction mushy_layer_depth
height (vertical coordinate)
InstantNucleationModel
Bases: ReducedModel
Implements the equations to solve the instant model.
This is an extension of the reduced model where the nucleation rate is infinite and and so any supersaturations is immediately converted to the gas phase. This means we do not need to solve the ODE for dissolved gas concentration in this case.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
NonDimensionalParams
|
Non-dimensional parameters |
required |
height
|
NDArray
|
Height values |
required |
temperature
|
NDArray
|
Temperature values |
required |
temperature_derivative
|
NDArray
|
Temperature derivative values |
required |
hydrostatic_pressure
|
NDArray
|
Hydrostatic pressure values |
required |
frozen_gas_fraction
|
NDArray
|
Frozen gas fraction |
required |
mushy_layer_depth
|
NDArray
|
Mushy layer depth |
required |
Source code in mush3p/model/instant.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
reduced
ReducedModel
Bases: IncompressibleModel
Implement the equations for the reduced model
The reduced model is an approximation to the full model where the exsolved gas volume fraction is small and incompressible. Under this approximation scheme the solid and liquid volume fractions sum to 1 and the exsolution of gas does not drive a liquid flow.
Source code in mush3p/model/reduced.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
output
NonDimensionalResults
Class to store non-dimensional solution profiles and provide methods to linearly interpolate them with depth.
The class also provides a save method to serialize the non-dimensional parameters and solution arrays to a JSON file, and a load method to deserialize them back into a NonDimensionalResults object.
The class calcualtes all mushy layer arrays using the model specified in the non-dimensional parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
non_dimensional_parameters
|
NonDimensionalParams
|
Non-dimensional parameters |
required |
temperature_array
|
ndarray
|
Temperature profile |
required |
temperature_derivative_array
|
ndarray
|
Temperature derivative profile |
required |
concentration_array
|
ndarray
|
Concentration profile |
required |
hydrostatic_pressure_array
|
ndarray
|
Hydrostatic pressure profile |
required |
frozen_gas_fraction
|
float
|
Frozen gas fraction |
required |
mushy_layer_depth
|
float
|
Mushy layer depth |
required |
height_array
|
ndarray
|
Vertical grid points. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Name of the simulation |
params |
NonDimensionalParams
|
Non-dimensional parameters |
temperature_array |
ndarray
|
Temperature profile |
temperature_derivative_array |
ndarray
|
Temperature derivative profile |
concentration_array |
ndarray
|
Concentration profile |
hydrostatic_pressure_array |
ndarray
|
Hydrostatic pressure profile |
frozen_gas_fraction |
float
|
Frozen gas fraction |
mushy_layer_depth |
float
|
Mushy layer depth |
height_array |
ndarray
|
Vertical grid points |
solid_salinity_array |
ndarray
|
Solid salinity profile |
liquid_salinity_array |
ndarray
|
Liquid salinity profile |
solid_fraction_array |
ndarray
|
Solid fraction profile |
liquid_fraction_array |
ndarray
|
Liquid fraction profile |
gas_fraction_array |
ndarray
|
Gas fraction profile |
gas_density_array |
ndarray
|
Gas density profile |
liquid_darcy_velocity_array |
ndarray
|
Liquid Darcy velocity profile |
gas_darcy_velocity_array |
ndarray
|
Gas Darcy velocity profile |
Source code in mush3p/output.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
params
NonDimensionalParams
dataclass
Non-dimensional parameters for the three phase mushy layer system.
Note: these can be initialised directly or by using the non_dimensionalise method of PhysicalParams.
This class also provides save and load methods to serialize and deserialize to JSON.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the simulation |
required |
model_choice
|
str
|
Choice of model to use, either "full", "incompressible", "reduced" or "instant" |
required |
concentration_ratio
|
float
|
Ratio of the far field salinity to the salinity difference |
required |
stefan_number
|
float
|
Ratio of the latent heat to the sensible heat |
required |
hele_shaw_permeability_scaled
|
float
|
Ratio of the permeability of the Hele-Shaw cell to the reference permeability |
required |
far_temperature_scaled
|
float
|
Non-dimensionalised far field temperature |
required |
damkholer_number
|
float
|
Ratio of the thermal time scale to the nucleation time scale |
required |
expansion_coefficient
|
float
|
Relative volume increase on exsolving a saturation amount of dissolved gas |
required |
stokes_rise_velocity_scaled
|
float
|
Ratio of the bubble Stokes' rise velocity to the reference velocity |
required |
bubble_radius_scaled
|
float
|
Ratio of the bubble radius to the pore throat radius |
required |
pore_throat_exponent
|
float
|
Power law exponent for pore throat radius as a function of porosity |
required |
far_dissolved_concentration_scaled
|
float
|
Ratio of the far field dissolved gas concentration to the saturation concentration |
required |
Source code in mush3p/params.py
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | |
PhysicalParams
dataclass
Dimensional parameters for the three phase mushy layer system.
This class implements the calculation of non-dimensional parameters for the system and provides the non_dimensionalise method to provide a NonDimensionalParams object.
This class also provides save and load methods to serialize and deserialize to JSON.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the simulation |
required |
model_choice
|
str
|
Choice of model to use, either "full", "incompressible", "reduced" or "instant" |
'full'
|
bubble_radius
|
float
|
Radius of the bubbles [m] |
0.001
|
nucleation_time_scale
|
float
|
Time scale for bubble nucleation [s] |
1000
|
far_salinity
|
float
|
Salinity of the far field [g/kg] |
35
|
far_temperature
|
float
|
Temperature of the far field [degC] |
0.1
|
far_dissolved_gas_concentration
|
float
|
Dissolved gas concentration in the far field [kg/kg] |
3.71e-05
|
reference_velocity
|
float
|
Pulling speed [m/s], the default value is 1 micron/s |
1e-06
|
liquid_density
|
float
|
Density of the liquid [kg/m3] |
1028
|
gravitational_acceleration
|
float
|
Acceleration due to gravity [m/s2] |
9.81
|
liquid_dynamic_viscosity
|
float
|
Dynamic viscosity of the liquid [kg/m s], the default value gives the same kinematic viscosity used in Moreau et al 2014. |
0.00278
|
surface_tension
|
float
|
Surface tension of the liquid [N/m] |
0.077
|
liquidus_slope
|
float
|
Slope of the liquidus curve [deg C / g/kg] |
0.07
|
eutectic_temperature
|
float
|
Eutectic temperature [deg C] |
-21.2
|
latent_heat
|
float
|
Latent heat of fusion [J/kg] |
333000.0
|
liquid_specific_heat_capacity
|
float
|
Specific heat capacity of the liquid [J/kg degC] |
4209
|
solid_specific_heat_capacity
|
float
|
Specific heat capacity of the solid [J/kg degC] |
2108
|
gas_specific_heat_capacity
|
float
|
Specific heat capacity of the gas [J/kg degC] |
1004
|
liquid_thermal_conductivity
|
float
|
Thermal conductivity of the liquid [W/m degC] |
0.523
|
solid_thermal_conductivity
|
float
|
Thermal conductivity of the solid [W/m degC] |
2.22
|
gas_thermal_conductivity
|
float
|
Thermal conductivity of the gas [W/m degC] |
0.02
|
hele_shaw_gap_width
|
float
|
Width of the Hele-Shaw cell [m], the default value is the same value used in the experiments of Peppin et al 2007 |
0.005
|
reference_permeability
|
float
|
Reference permeability [m2], the defulat value is the value used in Rees Jones and Worster 2014 |
1e-08
|
reference_pore_scale
|
float
|
Fitted pore throat radius at zero solid fraction [m], default value from Maus et al 2021 |
0.000195
|
pore_throat_exponent
|
float
|
Exponent for pore throat radius power law as a function of porosity, default value from Maus et al 2021 |
0.46
|
reference_saturation_concentration
|
float
|
Saturation concentration for dissolved gas [kg/kg] |
3.71e-05
|
specific_gas_constant
|
float
|
Specific gas constant [J/kg degK] |
286
|
atmospheric_pressure
|
float
|
Atmospheric pressure [Pa] |
101000.0
|
Source code in mush3p/params.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | |
eutectic_salinity: float
property
Calculated eutectic salinity from linear liquidus relation
initial_temperature: float
property
Liquidus freezing temperature of the liquid at salinty far_salinity
static_settings
get_initial_solution(model_choice)
Get intial solution for scipy solve_BVP which satisfies the boundary conditions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_choice
|
str
|
one of "full", "incompressible" "reduced" or "instant" |
required |
Returns: NDArray: initial solution for scipy solve_BVP
Source code in mush3p/static_settings.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |