API Reference
BRW09Forcing
Surface and ocean temperature data loaded from thermistor temperature record during the Barrow 2009 field study.
Source code in seaice3p/params/forcing.py
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 | |
__post_init__()
populate class attributes with barrow dimensional air temperature and time in days (with missing values filtered out).
Note the metadata explaining how to use the barrow temperature data is also in seaice3p/forcing_data. The indices corresponding to days and air temp are hard coded in as class variables.
Source code in seaice3p/params/forcing.py
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 | |
BRW09InitialConditions
dataclass
values for bottom (ocean) boundary
Source code in seaice3p/params/dimensional/initial_conditions.py
12 13 14 15 16 17 | |
BRW09OceanForcing
Ocean temperature provided by Barrow 2009 data at 2.4m and specify ocean fixed gas saturation state
Source code in seaice3p/params/ocean_forcing.py
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 | |
__post_init__()
populate class attributes with barrow dimensional ocean temperature and time in days (with missing values filtered out).
Note the metadata explaining how to use the barrow temperature data is also in seaice3p/forcing_data.
Source code in seaice3p/params/ocean_forcing.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
Config
dataclass
contains all information needed to run a simulation and save output
this config object can be saved and loaded to a yaml file.
Source code in seaice3p/params/params.py
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 | |
ConstantForcing
dataclass
Constant temperature forcing
Source code in seaice3p/params/forcing.py
37 38 39 40 41 42 | |
CubicLiquidus
dataclass
Cubic fit to liquidus to give liquidus salinity in terms of temperature
S = a0 + a1 T + a2 T^2 + a3 T^3
defaults are taken from Notz PhD thesis for fit to Assur seawater data
Source code in seaice3p/params/dimensional/water.py
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 | |
DISEQPhysicalParams
dataclass
Bases: BasePhysicalParams
non dimensional numbers for the mushy layer
Source code in seaice3p/params/physical.py
50 51 52 53 54 55 56 | |
DimensionalBRW09OceanForcing
dataclass
Ocean temperature provided by Barrow 2009 data at 2.4m and specify ocean fixed gas saturation state
Source code in seaice3p/params/dimensional/ocean_forcing.py
56 57 58 59 60 61 62 | |
DimensionalConstantTurbulentFlux
dataclass
Parameters for calculating the turbulent surface sensible and latent heat fluxes
NOTE: If you are running a simulation with ERA5 reanalysis forcing you must set the ref_height=2m as this is the appropriate value for the atmospheric reanalysis quantities
The windspeed given here will only be used with ERA5 forcing if the windspeed key is set to None in the forcing_data_file_keys dictionary.
Source code in seaice3p/params/dimensional/forcing.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
DimensionalERA5Forcing
read ERA5 data from netCDF file located at data_path.
Simulation will take atmospheric forcings from the start date specified in the string format YYYY-MM-DD
forcing_data_file_keys is a mapping of the descriptive names of the forcing data to be provided to the simulationa and the values are the corresponding strings giving the name of that variable in the netCDF file. The default values are the ERA5 variable names and the SnowModel-LG snow depth name.
Note that if you pass "sd" for the snow depth the simulation will assume you have provided snow depth in m of water equivalent and you must provide a snow density for the conversion.
If you pass None for the snow depth the simulation will procede with no snow layer. If you pass None for the windspeed the simulation will use the constant windspeed defined in the turbulent flux forcing parameters.
Source code in seaice3p/params/dimensional/forcing.py
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 | |
DimensionalFixedHeatFluxOceanForcing
dataclass
Provides constant ocean heat flux at the bottom of the domain
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ocean_heat_flux
|
float
|
The constant heat flux at the bottom of the domain in W/m2 |
1
|
Source code in seaice3p/params/dimensional/ocean_forcing.py
14 15 16 17 18 19 20 21 22 23 | |
DimensionalFixedTempOceanForcing
dataclass
Fixed temperature and gas saturation ocean boundary condition
Source code in seaice3p/params/dimensional/ocean_forcing.py
6 7 8 9 10 11 | |
DimensionalMonoBubbleParams
dataclass
Bases: DimensionalBaseBubbleParams
Source code in seaice3p/params/dimensional/bubble.py
15 16 17 18 19 20 21 22 23 24 25 26 27 | |
bubble_radius_scaled
property
calculate the bubble radius divided by the pore scale
.. math:: \Lambda = R_B / R_0
DimensionalMonthlyHeatFluxOceanForcing
dataclass
Provides constant ocean heat flux at the bottom of the domain in each month
Proivde an average monthly ocean heat flux with the entries i=0, 1, 2, 3, ...., 11 in the tuple corresponding to the months January, February, March, April, ...., December
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
monthly_ocean_heat_flux
|
Tuple[float, ...]
|
Tuple of ocean heat flux values in each month in W/m2 |
(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
|
Source code in seaice3p/params/dimensional/ocean_forcing.py
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 | |
DimensionalParams
dataclass
Contains all dimensional parameters needed to calculate non dimensional numbers.
To see the units each input should have look at the comment next to the default value.
Source code in seaice3p/params/dimensional/dimensional.py
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 | |
B
property
calculate the non dimensional scale for buoyant rise of gas bubbles as
.. math:: \mathcal{B} = \frac{\rho_l g R_0^2 h}{3 \mu \kappa}
Rayleigh_salt
property
Calculate the haline Rayleigh number as
.. math:: \text{Ra}_S = \frac{\rho_l g \beta \Delta S H K_0}{\kappa \mu}
damkohler_number
property
Return damkohler number as ratio of thermal timescale to nucleation timescale
expansion_coefficient
property
calculate
.. math:: \chi = \rho_l \xi_{\text{sat}} / \rho_g
frame_velocity
property
calculate the frame velocity in non dimensional units
lewis_gas
property
Calculate the lewis number for dissolved gas, return np.inf if there is no dissolved gas diffusion.
.. math:: \text{Le}\xi = \kappa / D\xi
savefreq
property
calculate the save frequency in non dimensional time
scales
property
return a Scales object used for converting between dimensional and non dimensional variables.
total_time
property
calculate the total time in non dimensional units for the simulation
load(path)
classmethod
load this object from a yaml configuration file.
Source code in seaice3p/params/dimensional/dimensional.py
198 199 200 201 202 203 | |
save(directory)
save this object to a yaml file in the specified directory.
The name will be the name given with _dimensional appended to distinguish it from a saved non-dimensional configuration.
Source code in seaice3p/params/dimensional/dimensional.py
190 191 192 193 194 195 196 | |
DimensionalPowerLawBubbleParams
dataclass
Bases: DimensionalBaseBubbleParams
Source code in seaice3p/params/dimensional/bubble.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
maximum_bubble_radius_scaled
property
calculate the bubble radius divided by the pore scale
.. math:: \Lambda = R_B / R_0
minimum_bubble_radius_scaled
property
calculate the bubble radius divided by the pore scale
.. math:: \Lambda = R_B / R_0
DimensionalRobinForcing
dataclass
This forcing imposes a Robin boundary condition of the form surface_heat_flux=heat_transfer_coefficient * (restoring_temp - surface_temp)
Source code in seaice3p/params/dimensional/forcing.py
164 165 166 167 168 169 170 171 172 | |
DimensionalWaterParams
dataclass
Source code in seaice3p/params/dimensional/water.py
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 | |
concentration_ratio
property
Calculate concentration ratio as
.. math:: \mathcal{C} = S_i / \Delta S
conductivity_ratio
property
Calculate the ratio of solid to liquid thermal conductivity
.. math:: \lambda = \frac{k_s}{k_l}
eddy_diffusivity_ratio
property
Calculate the ratio of eddy diffusivity to thermal diffusivity in the liquid phase
.. math:: \lambda = \frac{\kappa_\text{turbulent}}{\kappa_l}
lewis_salt
property
Calculate the lewis number for salt, return np.inf if there is no salt diffusion.
.. math:: \text{Le}_S = \kappa / D_s
ocean_freezing_temperature
property
calculate salinity dependent freezing temperature using linear liquidus with ocean salinity
.. math:: T_i = T_L(S_i) = T_E S_i / S_E
or using a cubic fit for the liquidus curve
salinity_difference
property
calculate difference between eutectic salinity and typical ocean salinity
.. math:: \Delta S = S_E - S_i
snow_conductivity_ratio
property
Calculate the ratio of snow to liquid thermal conductivity
.. math:: \lambda = \frac{k_{sn}}{k_l}
specific_heat_ratio
property
Calculate the ratio of solid to liquid specific heat capacities
.. math:: \lambda = \frac{c_{p,s}}{c_{p,l}}
stefan_number
property
calculate Stefan number
.. math:: \text{St} = L / c_p \Delta T
temperature_difference
property
calculate
.. math:: \Delta T = T_i - T_E
thermal_diffusivity
property
Return thermal diffusivity in m2/s
.. math:: \kappa = \frac{k}{\rho_l c_p}
EQMPhysicalParams
dataclass
Bases: BasePhysicalParams
non dimensional numbers for the mushy layer
Source code in seaice3p/params/physical.py
44 45 46 47 | |
ERA5Forcing
Forcing parameters for simulation forced with atmospheric variables from reanalysis data in netCDF file located at data_path.
Never create this object directly but instead initialise from a dimensional simulation configuration as we must pass it the simulation timescale to correctly read the atmospheric variables from the netCDF file.
Source code in seaice3p/params/forcing.py
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 | |
FixedHeatFluxOceanForcing
dataclass
Provides constant dimensionless ocean heat flux at the bottom of the domain and fixed gas saturation state.
Source code in seaice3p/params/ocean_forcing.py
27 28 29 30 31 32 33 34 | |
FixedTempOceanForcing
dataclass
Fixed temperature and gas saturation ocean boundary condition
Source code in seaice3p/params/ocean_forcing.py
18 19 20 21 22 23 24 | |
MonoBubbleParams
dataclass
Bases: BaseBubbleParams
Parameters for population of identical spherical bubbles.
Source code in seaice3p/params/bubble.py
24 25 26 27 28 29 | |
MonthlyHeatFluxOceanForcing
Provides constant dimensionless ocean heat flux at the bottom of the domain in each month
and ocean gas saturation state.
Proivde an average monthly ocean heat flux with the entries i=0, 1, 2, 3, ...., 11 in the tuple corresponding to the months January, February, March, April, ...., December
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
monthly_ocean_heat_flux
|
Tuple of dimensionless ocean heat flux values in |
required |
Source code in seaice3p/params/ocean_forcing.py
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 | |
NoBrineConvection
dataclass
No brine convection
Source code in seaice3p/params/dimensional/convection.py
5 6 7 8 | |
NumericalParams
dataclass
parameters needed for discretisation and choice of numerical method
Source code in seaice3p/params/dimensional/numerical.py
5 6 7 8 9 10 11 12 13 14 15 16 | |
OilInitialConditions
dataclass
values for bottom (ocean) boundary
Source code in seaice3p/params/initial_conditions.py
12 13 14 15 16 17 18 19 20 21 22 23 | |
PowerLawBubbleParams
dataclass
Bases: BaseBubbleParams
Parameters for population of bubbles following a power law size distribution between a minimum and maximum radius.
Source code in seaice3p/params/bubble.py
32 33 34 35 36 37 38 39 40 41 | |
RJW14Params
dataclass
Parameters for the RJW14 parameterisation of brine convection
Source code in seaice3p/params/convection.py
6 7 8 9 10 11 12 13 14 15 16 | |
RadForcing
dataclass
Forcing parameters for radiative transfer simulation with oil drops
we have not implemented the non-dimensionalisation for these parameters yet and so we just pass the dimensional values directly to the simulation
Source code in seaice3p/params/forcing.py
93 94 95 96 97 98 99 100 101 102 103 104 | |
RobinForcing
dataclass
Dimensionless forcing parameters for Robin boundary condition
Source code in seaice3p/params/forcing.py
221 222 223 224 225 226 227 | |
Scales
dataclass
Source code in seaice3p/params/convert.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 | |
time_scale
property
in days
velocity_scale
property
in m /day
convert_dimensional_bulk_air_to_argon_content(dimensional_bulk_gas)
Convert kg/m3 of air to micromole of Argon per Liter of ice
Source code in seaice3p/params/convert.py
81 82 83 84 85 86 87 88 89 90 91 | |
convert_from_dimensional_bulk_gas(dimensional_bulk_gas)
Non dimensionalise bulk gas content in kg/m3
Source code in seaice3p/params/convert.py
73 74 75 | |
convert_from_dimensional_bulk_salinity(dimensional_bulk_salinity)
Non dimensionalise bulk salinity in g/kg
Source code in seaice3p/params/convert.py
63 64 65 66 67 | |
convert_from_dimensional_dissolved_gas(dimensional_dissolved_gas)
convert from dissolved gas in kg(gas)/kg(liquid) to dimensionless
Source code in seaice3p/params/convert.py
93 94 95 | |
convert_from_dimensional_grid(dimensional_grid)
Non dimensionalise domain depths in meters
Source code in seaice3p/params/convert.py
47 48 49 | |
convert_from_dimensional_heat_flux(dimensional_heat_flux)
convert from heat flux in W/m2 to dimensionless units
Source code in seaice3p/params/convert.py
110 111 112 113 114 115 116 | |
convert_from_dimensional_heating(dimensional_heating)
convert from heating rate in W/m3 to dimensionless units
Source code in seaice3p/params/convert.py
102 103 104 105 106 107 108 | |
convert_from_dimensional_temperature(dimensional_temperature)
Non dimensionalise temperature in deg C
Source code in seaice3p/params/convert.py
35 36 37 38 39 | |
convert_from_dimensional_time(dimensional_time)
Non dimensionalise time in days
Source code in seaice3p/params/convert.py
55 56 57 | |
convert_to_dimensional_bulk_gas(bulk_gas)
Convert dimensionless bulk gas content to kg/m3
Source code in seaice3p/params/convert.py
77 78 79 | |
convert_to_dimensional_bulk_salinity(bulk_salinity)
Convert non dimensional bulk salinity to g/kg
Source code in seaice3p/params/convert.py
69 70 71 | |
convert_to_dimensional_dissolved_gas(dissolved_gas)
convert from non dimensional dissolved gas to dimensional dissolved gas in kg(gas)/kg(liquid)
Source code in seaice3p/params/convert.py
97 98 99 100 | |
convert_to_dimensional_grid(grid)
Get domain depths in meters from non dimensional values
Source code in seaice3p/params/convert.py
51 52 53 | |
convert_to_dimensional_heat_flux(heat_flux)
convert from dimensionless heat flux to heat flux in W/m2
Source code in seaice3p/params/convert.py
118 119 120 121 122 123 124 | |
convert_to_dimensional_temperature(temperature)
get temperature in deg C from non dimensional temperature
Source code in seaice3p/params/convert.py
41 42 43 44 45 | |
convert_to_dimensional_time(time)
Convert non dimensional time into time in days since start of simulation
Source code in seaice3p/params/convert.py
59 60 61 | |
UniformInitialConditions
dataclass
values for bottom (ocean) boundary
Source code in seaice3p/params/dimensional/initial_conditions.py
6 7 8 9 | |
YearlyForcing
dataclass
Yearly sinusoidal temperature forcing
Source code in seaice3p/params/forcing.py
45 46 47 48 49 50 51 52 | |
get_config(dimensional_params)
Return a Config object for the simulation.
physical parameters and Darcy law parameters are calculated from the dimensional input. You can modify the numerical parameters and boundary conditions and forcing provided for the simulation.
Source code in seaice3p/params/params.py
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 | |
enthalpy_method
enthalpy_method
Module containing enthalpy method to calculate state variables from bulk enthalpy, bulk salinity and bulk gas.
phase_boundaries
Module for calculating the phase boundaries needed for the enthalpy method.
calculates the phase boundaries neglecting the gas fraction so that
.. math:: \phi_s + \phi_l = 1
equations
RJW14
Module to calculate the sink terms for conservation equations when using the Rees Jones and Worster 2014 brine drainage parameterisation.
These terms represent loss through the brine channels and need to be added in the convecting region when using this parameterisation
brine_channel_sink_terms
_DISEQ_brine_convection_sink(state_BCs, cfg, grids)
TODO: check the sink terms for bulk_dissolved_gas and gas fraction
For now neglect the coupling of bubbles to the horizontal or vertical flow
Source code in seaice3p/equations/RJW14/brine_channel_sink_terms.py
45 46 47 48 49 50 51 52 53 54 | |
_EQM_brine_convection_sink(state_BCs, cfg, grids)
TODO: check the sink terms for bulk_dissolved_gas and gas fraction
For now neglect the coupling of bubbles to the horizontal or vertical flow
Source code in seaice3p/equations/RJW14/brine_channel_sink_terms.py
34 35 36 37 38 39 40 41 42 | |
_calculate_bulk_dissolved_gas_sink(state_BCs, cfg, grids)
This is for the DISEQ model
Source code in seaice3p/equations/RJW14/brine_channel_sink_terms.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
_calculate_gas_sink(state_BCs, cfg, grids)
This is for the EQM model
TODO: fix bug in bubble coupling to flow
Source code in seaice3p/equations/RJW14/brine_channel_sink_terms.py
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 | |
brine_drainage
Module to calculate the Rees Jones and Worster 2014 parameterisation for brine convection velocity and the strenght of the sink term.
Exports the functions:
calculate_brine_convection_liquid_velocity To be used in velocities module when using brine convection parameterisation.
calculate_brine_channel_sink To be used to add sink terms to conservation equations when using brine convection parameterisation.
calculate_Rayleigh(cell_centers, edge_grid, liquid_salinity, liquid_fraction, cfg)
Calculate the local Rayleigh number for brine convection as
.. math:: \text{Ra}(z) = \text{Ra}_S K(z) (z+h) \Theta_l
:param cell_centers: The vertical coordinates of cell centers. :type cell_centers: Numpy Array shape (I,) :param edge_grid: The vertical coordinate positions of the edge grid. :type edge_grid: Numpy Array (size I+1) :param liquid_salinity: liquid salinity on center grid :type liquid_salinity: Numpy Array shape (I,) :param liquid_fraction: liquid fraction on center grid :type liquid_fraction: Numpy Array (size I) :param cfg: Configuration object for the simulation. :type cfg: seaice3p.params.Config :return: Array of shape (I,) of Rayleigh number at cell centers
Source code in seaice3p/equations/RJW14/brine_drainage.py
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 | |
calculate_brine_channel_sink(liquid_fraction, liquid_salinity, center_grid, edge_grid, cfg)
Calculate the sink term due to brine channels.
.. math:: \text{sink} = \mathcal{A}
in the convecting region. Zero elsewhere.
NOTE: If no ice is present or if no convecting region exists returns zero
:param liquid_fraction: liquid fraction on center grid :type liquid_fraction: Numpy Array of shape (I,) :param liquid_salinity: liquid salinity on center grid :type liquid_salinity: Numpy Array of shape (I,) :param center_grid: vertical coordinate of center grid :type center_grid: Numpy Array of shape (I,) :param edge_grid: Vertical coordinates of cell edges :type edge_grid: Numpy Array of shape (I+1,) :param cfg: Configuration object for the simulation. :type cfg: seaice3p.params.Config :return: Strength of the sink term due to brine channels on the center grid.
Source code in seaice3p/equations/RJW14/brine_drainage.py
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 309 310 311 | |
calculate_brine_channel_strength(Rayleigh_number, ice_depth, convecting_region_height, cfg)
Calculate the brine channel strength in the convecting region as
.. math:: \mathcal{A} = \frac{\alpha \text{Ra}_e}{(h+z_c)^2}
the effective Rayleigh number multiplied by a tuning parameter (Rees Jones and Worster 2014) over the convecting region thickness squared.
:param Rayleigh_number: local Rayleigh number on center grid :type Rayleigh_number: Numpy Array of shape (I,) :param ice_depth: depth of ice (positive) :type ice_depth: float :param convecting_region_height: position of the convecting region boundary (negative) :type convecting_region_height: float :param cfg: Configuration object for the simulation. :type cfg: seaice3p.params.Config :return: Brine channel strength parameter
Source code in seaice3p/equations/RJW14/brine_drainage.py
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 | |
calculate_brine_convection_liquid_velocity(liquid_fraction, liquid_salinity, center_grid, edge_grid, cfg)
Calculate the vertical liquid Darcy velocity from Rees Jones and Worster 2014
.. math:: W_l = \mathcal{A} (z_c - z)
in the convecting region. The velocity is stagnant above the convecting region. The velocity is constant in the liquid region and continuous at the interface.
NOTE: If no ice is present or if no convecting region exists returns zero velocity
:param liquid_fraction: liquid fraction on center grid :type liquid_fraction: Numpy Array of shape (I,) :param liquid_salinity: liquid salinity on center grid :type liquid_salinity: Numpy Array of shape (I,) :param center_grid: vertical coordinate of center grid :type center_grid: Numpy Array of shape (I,) :param edge_grid: Vertical coordinates of cell edges :type edge_grid: Numpy Array of shape (I+1,) :param cfg: Configuration object for the simulation. :type cfg: seaice3p.params.Config :return: Liquid darcy velocity on the edge grid.
Source code in seaice3p/equations/RJW14/brine_drainage.py
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 | |
calculate_integrated_mean_permeability(z, liquid_fraction, ice_depth, cell_centers, cfg)
Calculate the harmonic mean permeability from the base of the ice up to the cell containing the specified z value using the expression of ReesJones2014.
.. math:: K(z) = (\frac{1}{h+z}\int_{-h}^{z} \frac{1}{\Pi(\phi_l(z'))}dz')^{-1}
:param z: height to integrate permeability up to :type z: float :param liquid_fraction: liquid fraction on the center grid :type liquid_fraction: Numpy Array shape (I,) :param ice_depth: positive depth position of ice ocean interface :type ice_depth: float :param cell_centers: cell center positions :type cell_centers: Numpy Array of shape (I,) :param cfg: Configuration object for the simulation. :type cfg: seaice3p.params.Config :return: permeability averaged from base of the ice up to given z value
Source code in seaice3p/equations/RJW14/brine_drainage.py
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 | |
calculate_permeability(liquid_fraction, cfg)
Calculate the absolute permeability as a function of liquid fraction
.. math:: \Pi(\phi_l) = \phi_l^3
Alternatively if the porosity threshold flag is true
.. math:: \Pi(\phi_l) = \phi_l^2 (\phi_l - \phi_c)
:param liquid_fraction: liquid fraction :type liquid_fraction: Numpy Array :param cfg: Configuration object for the simulation. :type cfg: seaice3p.params.Config :return: permeability on the same grid as liquid fraction
Source code in seaice3p/equations/RJW14/brine_drainage.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
get_convecting_region_height(Rayleigh_number, edge_grid, cfg)
Calculate the height of the convecting region as the top edge of the highest cell in the domain for which the quantity
.. math:: \text{Ra}(z) - \text{Ra}_c
is greater than or equal to zero.
NOTE: if no convecting region exists return np.nan
:param Rayleigh_number: local rayleigh number on center grid :type Rayleigh_number: Numpy Array of shape (I,) :param edge_grid: The vertical coordinate positions of the edge grid. :type edge_grid: Numpy Array (size I+1) :param cfg: Configuration object for the simulation. :type cfg: seaice3p.params.Config :return: Edge grid value at convecting boundary.
Source code in seaice3p/equations/RJW14/brine_drainage.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
get_effective_Rayleigh_number(Rayleigh_number, cfg)
Calculate the effective Rayleigh Number as the maximum of
.. math:: \text{Ra}(z) - \text{Ra}_c
in the convecting region.
NOTE: if no convecting region exists returns 0.
:param Rayleigh_number: local rayleigh number on center grid :type Rayleigh_number: Numpy Array of shape (I,) :param cfg: Configuration object for the simulation. :type cfg: seaice3p.params.Config :return: Effective Rayleigh number.
Source code in seaice3p/equations/RJW14/brine_drainage.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
equations
_prevent_gas_rise_into_saturated_cell(Vg, state_BCs, cfg)
Modify the gas interstitial velocity to prevent bubble rise into a cell which is already theoretically saturated with gas.
From the state with boundary conditions calculate the gas and solid fraction in the cells (except at lower ghost cell). If any of these are such that there is more gas fraction than pore space available then set gas insterstitial velocity to zero on the edge below. Make sure the very top boundary velocity is not changed as we want to always alow flux to the atmosphere regardless of the boundary conditions imposed.
:param Vg: gas insterstitial velocity on cell edges :type Vg: Numpy array (size I+1) :param state_BCs: state of system with boundary conditions :type state_BCs: seaice3p.state.StateBCs :return: filtered gas interstitial velocities on edges to prevent gas rise into a fully gas saturated cell
Source code in seaice3p/equations/equations.py
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 | |
flux
Module for calculating the fluxes using upwind scheme
bulk_dissolved_gas_flux
calculate the flux terms for the dissolved gas equation in DISEQ model
gas_fraction_flux
Calculate gas phase fluxes for disequilibrium model
heat_flux
calculate_conductive_heat_flux(state_BCs, D_g, cfg)
Calculate conductive heat flux as
.. math:: -[(\phi_l + \lambda \phi_s) \frac{\partial \theta}{\partial z}]
:param temperature: temperature including ghost cells :type temperature: Numpy Array of size I+2 :param D_g: difference matrix for ghost grid :type D_g: Numpy Array :param cfg: Simulation configuration :type cfg: seaice3p.params.Config :return: conductive heat flux
Source code in seaice3p/equations/flux/heat_flux.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
pure_liquid_switch(liquid_fraction)
Take the liquid fraction and return a smoothed switch that is equal to 1 in a pure liquid region and goes to zero rapidly outside of this
Source code in seaice3p/equations/flux/heat_flux.py
8 9 10 11 12 | |
salt_flux
calculate_diffusive_salt_flux(liquid_salinity, liquid_fraction, D_g, cfg)
Take liquid salinity and liquid fraction on ghost grid and interpolate liquid fraction geometrically
Source code in seaice3p/equations/flux/salt_flux.py
8 9 10 11 12 13 14 15 16 17 18 19 | |
nucleation
_DISEQ_nucleation(state_BCs, cfg)
implement nucleation term
Source code in seaice3p/equations/nucleation.py
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 | |
_EQM_nucleation(state_BCs, cfg)
implement nucleation term
Source code in seaice3p/equations/nucleation.py
21 22 23 24 | |
radiative_heating
Calculate internal shortwave radiative heating due to oil droplets
_calculate_non_dimensional_shortwave_heating(state_bcs, cfg, grids)
Calculate internal shortwave heating due to oil droplets on center grid
Assumes a configuration with the RadForcing object as the forcing config is passed.
Source code in seaice3p/equations/radiative_heating.py
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 | |
get_radiative_heating(cfg, grids)
Calculate internal shortwave heating source for enthalpy equation.
if the RadForcing object is given as the forcing config then calculates internal heating based on the object given in the configuration for oil_heating.
If another forcing is chosen then just returns a function to create an array of zeros as no internal heating is calculated.
Source code in seaice3p/equations/radiative_heating.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
velocities
Module to calculate Darcy velocities.
The liquid Darcy velocity must be parameterised.
The gas Darcy velocity is calculated as gas_fraction x interstitial bubble velocity
Interstitial bubble velocity is found by a steady state Stoke's flow calculation. We have implemented two cases mono: All bubbles nucleate and remain the same size power_law: A power law bubble size distribution with fixed max and min.
bubble_parameters
calculate_bubble_size_fraction(bubble_radius_scaled, liquid_fraction, cfg)
Takes bubble radius scaled and liquid fraction on edges and calculates the bubble size fraction as
.. math:: \lambda = \Lambda / (\phi_l^q + \text{reg})
Returns the bubble size fraction on the edge grid.
Source code in seaice3p/equations/velocities/bubble_parameters.py
4 5 6 7 8 9 10 11 12 13 14 15 | |
mono_distribution
calculate_lag_function(bubble_size_fraction)
Calculate lag function from bubble size fraction on edge grid as
.. math:: G(\lambda) = 1 - \lambda / 2
for 0<lambda<1. Edge cases are given by G(0)=1 and G(1) = 0.5 for values outside this range.
Source code in seaice3p/equations/velocities/mono_distribution.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
calculate_mono_lag_factor(liquid_fraction, cfg)
Take liquid fraction on the ghost grid and calculate the lag factor for a mono bubble size distribution as
.. math:: I_2 = G(\lambda)
returns lag factor on the edge grid
Source code in seaice3p/equations/velocities/mono_distribution.py
71 72 73 74 75 76 77 78 79 80 81 82 83 | |
calculate_mono_wall_drag_factor(liquid_fraction, cfg)
Take liquid fraction on the ghost grid and calculate the wall drag factor for a mono bubble size distribution as
.. math:: I_1 = \frac{\lambda^2}{K(\lambda)}
returns wall drag factor on the edge grid
Source code in seaice3p/equations/velocities/mono_distribution.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
calculate_wall_drag_function(bubble_size_fraction, cfg)
Calculate wall drag function from bubble size fraction on edge grid as
.. math:: \frac{1}{K(\lambda)} = (1 - \lambda)^r
in the power law case or in the Haberman case from the paper
.. math:: \frac{1}{K(\lambda)} = \frac{1 -1.5\lambda + 1.5\lambda^5 - \lambda^6}{1+1.5\lambda^5}
for 0<lambda<1. Edge cases are given by K(0)=1 and K(1) = 0 for values outside this range.
Source code in seaice3p/equations/velocities/mono_distribution.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
power_law_distribution
calculate_lag_integrand(bubble_size_fraction, cfg)
Scalar function to calculate lag integrand for polydispersive case.
Bubble size fraction is given as a scalar input to calculate
.. math:: \lambda^{3-p} G(\lambda)
Source code in seaice3p/equations/velocities/power_law_distribution.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
calculate_power_law_lag_factor(liquid_fraction, cfg)
Take liquid fraction on the ghost grid and calculate the lag factor for power law bubble size distribution.
Return on edge grid
Source code in seaice3p/equations/velocities/power_law_distribution.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
calculate_power_law_wall_drag_factor(liquid_fraction, cfg)
Take liquid fraction on the ghost grid and calculate the wall drag factor for power law bubble size distribution.
Return on edge grid
Source code in seaice3p/equations/velocities/power_law_distribution.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
calculate_volume_integrand(bubble_size_fraction, cfg)
Scalar function to calculate the integrand for volume under a power law bubble size distribution given as
.. math:: \lambda^{3-p}
in terms of the bubble size fraction.
Source code in seaice3p/equations/velocities/power_law_distribution.py
58 59 60 61 62 63 64 65 66 67 | |
calculate_wall_drag_integrand(bubble_size_fraction, cfg)
Scalar function to calculate wall drag integrand for polydispersive case.
Bubble size fraction is given as a scalar input to calculate
.. math:: \frac{\lambda^{5-p}}{K(\lambda)}
where the wall drag enhancement funciton K can be given by a power law fit or taken from the Haberman paper.
Source code in seaice3p/equations/velocities/power_law_distribution.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 | |
velocities
calculate_gas_interstitial_velocity(liquid_fraction, liquid_darcy_velocity, wall_drag_factor, lag_factor, cfg)
Calculate Vg from liquid fraction on the ghost frid and liquid interstitial velocity
.. math:: V_g = \mathcal{B} (\phi_l^{2q} I_1) + U_0 I_2
Return Vg on edge grid
Source code in seaice3p/equations/velocities/velocities.py
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 | |
calculate_liquid_darcy_velocity(liquid_fraction, liquid_salinity, center_grid, edge_grid, cfg)
Calculate liquid Darcy velocity either using brine convection parameterisation or as stagnant
:param liquid_fraction: liquid fraction on ghost grid :type liquid_fraction: Numpy Array (size I+2) :param liquid_salinity: liquid salinity on ghost grid :type liquid_salinity: Numpy Array (size I+2) :param center_grid: vertical coordinates of cell centers :type center_grid: Numpy Array of shape (I,) :param edge_grid: Vertical coordinates of cell edges :type edge_grid: Numpy Array (size I+1) :param cfg: simulation configuration object :type cfg: seaice3p.params.Config :return: liquid darcy velocity on edge grid
Source code in seaice3p/equations/velocities/velocities.py
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 | |
calculate_velocities(state_BCs, cfg)
Inputs on ghost grid, outputs on edge grid
needs the simulation config, liquid fraction, liquid salinity and grids
Source code in seaice3p/equations/velocities/velocities.py
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 | |
example
Script to run a simulation starting with dimensional parameters and plot output
main(data_directory, frames_directory, simulation_dimensional_params)
Generate non dimensional simulation config and save along with dimensional config then run simulation and save data.
Source code in seaice3p/example.py
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 | |
forcing
boundary_conditions
Module to provide functions to add boundary conditions to each quantity on the centered grid that needs to be on the ghost grid for the upwind scheme.
_dissolved_gas_BCs(dissolved_gas_centers, cfg)
Add ghost cells with BCs to center quantity
Source code in seaice3p/forcing/boundary_conditions.py
90 91 92 93 94 | |
_enthalpy_BCs(enthalpy_centers, cfg, bottom_temperature)
Add ghost cells with BCs to center quantity
Source code in seaice3p/forcing/boundary_conditions.py
134 135 136 137 138 | |
_gas_BCs(gas_centers, cfg)
Add ghost cells with BCs to center quantity
Source code in seaice3p/forcing/boundary_conditions.py
111 112 113 114 115 | |
_gas_fraction_BCs(gas_fraction_centers, cfg)
Add ghost cells with BCs to center quantity
Source code in seaice3p/forcing/boundary_conditions.py
97 98 99 100 101 102 103 104 105 106 107 108 | |
_liquid_fraction_BCs(liquid_fraction_centers)
Add ghost cells to liquid fraction such that top and bottom boundaries take the same value as the top and bottom cell center
Source code in seaice3p/forcing/boundary_conditions.py
146 147 148 149 150 151 152 153 | |
_liquid_salinity_BCs(liquid_salinity_centers, cfg)
Add ghost cells with BCs to center quantity
Source code in seaice3p/forcing/boundary_conditions.py
118 119 120 121 122 | |
_salt_BCs(salt_centers, cfg)
Add ghost cells with BCs to center quantity
Source code in seaice3p/forcing/boundary_conditions.py
141 142 143 | |
_temperature_BCs(state, cfg)
Add ghost cells with BCs to center quantity
Note this needs the current time as well as top temperature is forced.
Source code in seaice3p/forcing/boundary_conditions.py
125 126 127 128 129 130 131 | |
radiative_forcing
Module for providing surface radiative forcing to simulation.
Currently only total surface shortwave irradiance (integrated over entire shortwave part of the spectrum) is provided and this is used to calculate internal radiative heating.
Unlike temperature forcing this provides dimensional forcing
_constant_LW_forcing(time, cfg)
Returns constant surface longwave downwelling irradiance in W/m2 integrated over the entire longwave spectrum
Source code in seaice3p/forcing/radiative_forcing.py
37 38 39 40 41 | |
_constant_SW_forcing(time, cfg)
Returns constant surface shortwave downwelling irradiance in W/m2 integrated over the entire shortwave spectrum
Source code in seaice3p/forcing/radiative_forcing.py
21 22 23 24 25 | |
surface_energy_balance
surface_energy_balance
Module to compute the surface heat flux from geophysical energy balance
following [1]
Refs: [1] P. D. Taylor and D. L. Feltham, ‘A model of melt pond evolution on sea ice’, J. Geophys. Res., vol. 109, no. C12, p. 2004JC002361, Dec. 2004, doi: 10.1029/2004JC002361.
_calculate_total_heat_flux(cfg, time, top_cell_is_ice, surface_temp, temp_gradient, top_cell_conductivity)
Takes non-dimensional surface temperature and returns non-dimensional heat flux
Source code in seaice3p/forcing/surface_energy_balance/surface_energy_balance.py
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 | |
find_ghost_cell_temperature(state, cfg)
Returns non dimensional ghost cell temperature such that surface heat flux is the sum of incoming LW, outgoing LW, sensible and latent heat fluxes. The SW heat flux is determined in the radiative heating term.
Source code in seaice3p/forcing/surface_energy_balance/surface_energy_balance.py
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 | |
turbulent_heat_flux
Module to compute the turbulent atmospheric sensible and latent heat fluxes
All temperatures are in Kelvin in this module
Refs: [1] P. D. Taylor and D. L. Feltham, ‘A model of melt pond evolution on sea ice’, J. Geophys. Res., vol. 109, no. C12, p. 2004JC002361, Dec. 2004, doi: 10.1029/2004JC002361.
[2] E. E. Ebert and J. A. Curry, ‘An intermediate one-dimensional thermodynamic sea ice model for investigating ice-atmosphere interactions’, Journal of Geophysical Research: Oceans, vol. 98, no. C6, pp. 10085–10109, 1993, doi: 10.1029/93JC00656.
_calculate_bulk_transfer_coefficient(cfg, top_cell_is_ice, time, surface_temp)
Calculation of bulk transfer coeff from [2]
Source code in seaice3p/forcing/surface_energy_balance/turbulent_heat_flux.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
_calculate_ref_air_temp(cfg, time)
return air temperature at reference level above the ice in Kelvin
in the configuration the air temperature is given in deg C
Source code in seaice3p/forcing/surface_energy_balance/turbulent_heat_flux.py
36 37 38 39 40 41 42 43 44 45 46 | |
_calculate_ref_atmospheric_pressure(cfg, time)
return atmospheric pressure at reference level above the ice in KPa
Source code in seaice3p/forcing/surface_energy_balance/turbulent_heat_flux.py
59 60 61 62 63 64 65 66 | |
_calculate_ref_specific_humidity(cfg, time)
return specific humidity at reference level above the ice
Source code in seaice3p/forcing/surface_energy_balance/turbulent_heat_flux.py
49 50 51 52 53 54 55 56 | |
_calculate_ref_windspeed(cfg, time)
return windspeed at reference level above the ice
Source code in seaice3p/forcing/surface_energy_balance/turbulent_heat_flux.py
26 27 28 29 30 31 32 33 | |
_calculate_surface_specific_humidity(cfg, time, surface_temp)
Following expression given in [1]
Source code in seaice3p/forcing/surface_energy_balance/turbulent_heat_flux.py
95 96 97 98 99 100 101 102 103 104 105 | |
calculate_latent_heat_flux(cfg, time, top_cell_is_ice, surface_temp)
Calculate latent heat flux from [2]
Source code in seaice3p/forcing/surface_energy_balance/turbulent_heat_flux.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
calculate_sensible_heat_flux(cfg, time, top_cell_is_ice, surface_temp)
Calculate sensible heat flux from [2]
Source code in seaice3p/forcing/surface_energy_balance/turbulent_heat_flux.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
temperature_forcing
Module for providing surface temperature forcing to simulation.
Note that the barrow temperature data is read in from a file if needed by the simulation configuration.
_Robin_forcing(state, cfg)
Returns non dimensional ghost cell temperature such that surface heat flux is given by Robin boundary condition
Source code in seaice3p/forcing/temperature_forcing.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
_barrow_ocean_temperature_forcing(state, cfg)
Take non dimensional time and return non dimensional ocean temperature at the Barrow site in 2009.
For this to work you must have created the configuration cfg from dimensional parameters as it must have the conversion scales object.
Source code in seaice3p/forcing/temperature_forcing.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
_barrow_temperature_forcing(state, cfg)
Take non dimensional time and return non dimensional air/snow/ice temperature at the Barrow site in 2009.
For this to work you must have created the configuration cfg from dimensional parameters as it must have the conversion scales object.
Source code in seaice3p/forcing/temperature_forcing.py
71 72 73 74 75 76 77 78 79 80 81 82 83 | |
_dimensional_barrow_ocean_temperature_forcing(time_in_days, cfg)
Take time in days and linearly interp 2009 Barrow ocean temperature data to get temperature in degrees Celsius.
Source code in seaice3p/forcing/temperature_forcing.py
110 111 112 113 114 115 116 117 118 | |
_dimensional_barrow_temperature_forcing(time_in_days, cfg)
Take time in days and linearly interp 2009 Barrow air/snow/ice temperature data to get temperature in degrees Celsius.
Source code in seaice3p/forcing/temperature_forcing.py
62 63 64 65 66 67 68 | |
grids
Module providing functions to initialise the different grids and interpolate quantities between them.
Grids
dataclass
Class initialised from number of grid cells to contain:
grid cell width, center, edge and ghost grids and difference matrices
Source code in seaice3p/grids.py
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 | |
D_e
cached
property
Difference matrix to differentiate edge grid quantities to the center grid
D_g
cached
property
Difference matrix to differentiate ghost grid quantities to the edge grid
centers
cached
property
Center grid
edges
cached
property
Edge grid
ghosts
cached
property
Ghost grid
step
cached
property
Grid cell width
add_ghost_cells(centers, bottom, top)
Add specified bottom and top value to center grid
:param centers: numpy array on centered grid (size I). :type centers: Numpy array :param bottom: bottom value placed at index 0. :type bottom: float :param top: top value placed at index -1. :type top: float :return: numpy array on ghost grid (size I+2).
Source code in seaice3p/grids.py
89 90 91 92 93 94 95 96 97 98 99 100 | |
average(points)
Returns arithmetic mean of adjacent points in an array
takes ghosts -> edges -> centers
Source code in seaice3p/grids.py
79 80 81 82 83 84 85 86 | |
calculate_ice_ocean_boundary_depth(liquid_fraction, edge_grid)
Calculate the depth of the ice ocean boundary as the edge position of the first cell from the bottom to be not completely liquid. I.e the first time the liquid fraction goes below 1.
If the ice has made it to the bottom of the domain raise an error.
If the domain is completely liquid set h=0.
NOTE: depth is a positive quantity and our grid coordinate increases from -1 at the bottom of the domain to 0 at the top.
:param liquid_fraction: liquid fraction on center grid :type liquid_fraction: Numpy Array (size I) :param edge_grid: The vertical coordinate positions of the edge grid. :type edge_grid: Numpy Array (size I+1) :return: positive depth value of ice ocean interface
Source code in seaice3p/grids.py
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 | |
geometric(ghosts)
Returns geometric mean of the first dimension of an array
Source code in seaice3p/grids.py
72 73 74 75 76 | |
initial_conditions
Module to provide initial state of bulk enthalpy, bulk salinity and bulk gas for the simulation.
_apply_value_in_ice_layer(depth_of_ice, ice_value, liquid_value, grid)
assume that top part of domain contains mushy ice of given depth and lower part of domain is liquid. This function returns output on the given grid where the ice part of the domain takes one value and the liquid a different.
This is useful for initialising the barrow simulation where we have an initial ice layer.
Source code in seaice3p/initial_conditions.py
46 47 48 49 50 51 52 53 54 55 | |
_get_barrow_initial_conditions(cfg)
initialise domain with an initial ice layer of given temperature and bulk salinity. These values are hard coded in from Moreau paper to match barrow study. They also assume that the initial ice layer has 1/5 the saturation amount in pure liquid of dissolved gas to account for previous gas loss.
Initialise with bulk gas being (1/5) in ice and saturation in liquid. Bulk salinity is 5.92 g/kg in ice and ocean value in liquid. Enthalpy is calculated by inverting temperature relation in ice and ocean. Ice temperature is given as -8.15 degC and ocean is the far value from boundary config.
Source code in seaice3p/initial_conditions.py
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 | |
_get_oil_initial_conditions(cfg)
initialise domain with an initial ice layer of given temperature and bulk salinity given by values in the configuration.
This is an idealised initial condition to investigate the impact of shortwave radiative forcing on melting bare ice
Source code in seaice3p/initial_conditions.py
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 | |
_get_previous_simulation_final_state(cfg)
Generate initial state from the final state of a saved simulation
:returns: initial solution arrays on ghost grid (enthalpy, salt, gas)
Source code in seaice3p/initial_conditions.py
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 | |
_get_uniform_initial_conditions(cfg)
Generate uniform initial solution on the ghost grid
:returns: initial solution arrays on ghost grid (enthalpy, salt, gas)
Source code in seaice3p/initial_conditions.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
load
DISEQResults
dataclass
Bases: _BaseResults
Source code in seaice3p/load.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
bulk_gas
property
Dimensionless bulk gas the same as the EQM model
_BaseResults
dataclass
Source code in seaice3p/load.py
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 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | |
bulk_argon
property
in mircomole Ar/L
corrected_liquid_fraction
property
Adjusted so that corrected_solid_fraction + corrected_liquid_fraction + gas_fraction = 1
corrected_solid_fraction
property
Adjusted so that corrected_solid_fraction + corrected_liquid_fraction + gas_fraction = 1
dimensional_meltpond_onset_time
property
Get meltpond onset time from start of simulation in days
oil_mass_ratio
property
in ng/g
_is_ice(time)
Boolean mask True where ice is present on center grid cells at given non-dimensional time
Source code in seaice3p/load.py
60 61 62 63 | |
_top_cell_is_ice(time)
Return True if top cell is ice or False if liquid
Source code in seaice3p/load.py
65 66 67 | |
emitted_LW(time)
W/m2 radiated away from ice surface
Source code in seaice3p/load.py
279 280 281 282 | |
ice_bulk_gas_content(time)
To get dimensional bulk gas in ice multiply by gas_density * lengthscale
Source code in seaice3p/load.py
251 252 253 254 255 256 257 | |
latent_heat_flux(time)
W/m2
Source code in seaice3p/load.py
273 274 275 276 277 | |
net_LW(time)
W/m2 net into ice
Source code in seaice3p/load.py
284 285 286 287 | |
sensible_heat_flux(time)
W/m2
Source code in seaice3p/load.py
267 268 269 270 271 | |
surface_heat_flux(time)
W/m2 net into ice
Source code in seaice3p/load.py
289 290 291 292 293 294 295 | |
surface_temp_K(time)
Return surface temperature in K
Source code in seaice3p/load.py
259 260 261 262 263 264 265 | |
total_albedo(time)
Total albedo including the effect of the surface scattering layer if present, if not present then the penetration fraction is 1 and so we regain just albedo calculated from the two stream radiative transfer model
Source code in seaice3p/load.py
135 136 137 138 139 140 | |
total_bulk_gas_content(time)
To get dimensional bulk gas in domain multiply by gas_density * lengthscale
Source code in seaice3p/load.py
244 245 246 247 248 249 | |
total_transmittance(time)
Total spectrally integrated transmittance
Source code in seaice3p/load.py
142 143 144 145 | |
oil_mass
convert_gas_fraction_to_oil_mass_ratio(gas_fraction, oil_density, ice_density)
Convert gas (oil) volume fraction to oil mass ratio in ng/g
Source code in seaice3p/oil_mass.py
4 5 6 7 8 | |
convert_oil_mass_ratio_to_gas_fraction(oil_mass_ratio, oil_density, ice_density)
Convert oil mass ratio in ng/g to gas (oil) volume fraction
Source code in seaice3p/oil_mass.py
11 12 13 14 15 | |
params
BRW09InitialConditions
dataclass
values for bottom (ocean) boundary
Source code in seaice3p/params/dimensional/initial_conditions.py
12 13 14 15 16 17 | |
CubicLiquidus
dataclass
Cubic fit to liquidus to give liquidus salinity in terms of temperature
S = a0 + a1 T + a2 T^2 + a3 T^3
defaults are taken from Notz PhD thesis for fit to Assur seawater data
Source code in seaice3p/params/dimensional/water.py
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 | |
DimensionalBRW09OceanForcing
dataclass
Ocean temperature provided by Barrow 2009 data at 2.4m and specify ocean fixed gas saturation state
Source code in seaice3p/params/dimensional/ocean_forcing.py
56 57 58 59 60 61 62 | |
DimensionalConstantTurbulentFlux
dataclass
Parameters for calculating the turbulent surface sensible and latent heat fluxes
NOTE: If you are running a simulation with ERA5 reanalysis forcing you must set the ref_height=2m as this is the appropriate value for the atmospheric reanalysis quantities
The windspeed given here will only be used with ERA5 forcing if the windspeed key is set to None in the forcing_data_file_keys dictionary.
Source code in seaice3p/params/dimensional/forcing.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
DimensionalERA5Forcing
read ERA5 data from netCDF file located at data_path.
Simulation will take atmospheric forcings from the start date specified in the string format YYYY-MM-DD
forcing_data_file_keys is a mapping of the descriptive names of the forcing data to be provided to the simulationa and the values are the corresponding strings giving the name of that variable in the netCDF file. The default values are the ERA5 variable names and the SnowModel-LG snow depth name.
Note that if you pass "sd" for the snow depth the simulation will assume you have provided snow depth in m of water equivalent and you must provide a snow density for the conversion.
If you pass None for the snow depth the simulation will procede with no snow layer. If you pass None for the windspeed the simulation will use the constant windspeed defined in the turbulent flux forcing parameters.
Source code in seaice3p/params/dimensional/forcing.py
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 | |
DimensionalFixedHeatFluxOceanForcing
dataclass
Provides constant ocean heat flux at the bottom of the domain
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ocean_heat_flux
|
float
|
The constant heat flux at the bottom of the domain in W/m2 |
1
|
Source code in seaice3p/params/dimensional/ocean_forcing.py
14 15 16 17 18 19 20 21 22 23 | |
DimensionalFixedTempOceanForcing
dataclass
Fixed temperature and gas saturation ocean boundary condition
Source code in seaice3p/params/dimensional/ocean_forcing.py
6 7 8 9 10 11 | |
DimensionalMonoBubbleParams
dataclass
Bases: DimensionalBaseBubbleParams
Source code in seaice3p/params/dimensional/bubble.py
15 16 17 18 19 20 21 22 23 24 25 26 27 | |
bubble_radius_scaled
property
calculate the bubble radius divided by the pore scale
.. math:: \Lambda = R_B / R_0
DimensionalMonthlyHeatFluxOceanForcing
dataclass
Provides constant ocean heat flux at the bottom of the domain in each month
Proivde an average monthly ocean heat flux with the entries i=0, 1, 2, 3, ...., 11 in the tuple corresponding to the months January, February, March, April, ...., December
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
monthly_ocean_heat_flux
|
Tuple[float, ...]
|
Tuple of ocean heat flux values in each month in W/m2 |
(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
|
Source code in seaice3p/params/dimensional/ocean_forcing.py
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 | |
DimensionalParams
dataclass
Contains all dimensional parameters needed to calculate non dimensional numbers.
To see the units each input should have look at the comment next to the default value.
Source code in seaice3p/params/dimensional/dimensional.py
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 | |
B
property
calculate the non dimensional scale for buoyant rise of gas bubbles as
.. math:: \mathcal{B} = \frac{\rho_l g R_0^2 h}{3 \mu \kappa}
Rayleigh_salt
property
Calculate the haline Rayleigh number as
.. math:: \text{Ra}_S = \frac{\rho_l g \beta \Delta S H K_0}{\kappa \mu}
damkohler_number
property
Return damkohler number as ratio of thermal timescale to nucleation timescale
expansion_coefficient
property
calculate
.. math:: \chi = \rho_l \xi_{\text{sat}} / \rho_g
frame_velocity
property
calculate the frame velocity in non dimensional units
lewis_gas
property
Calculate the lewis number for dissolved gas, return np.inf if there is no dissolved gas diffusion.
.. math:: \text{Le}\xi = \kappa / D\xi
savefreq
property
calculate the save frequency in non dimensional time
scales
property
return a Scales object used for converting between dimensional and non dimensional variables.
total_time
property
calculate the total time in non dimensional units for the simulation
load(path)
classmethod
load this object from a yaml configuration file.
Source code in seaice3p/params/dimensional/dimensional.py
198 199 200 201 202 203 | |
save(directory)
save this object to a yaml file in the specified directory.
The name will be the name given with _dimensional appended to distinguish it from a saved non-dimensional configuration.
Source code in seaice3p/params/dimensional/dimensional.py
190 191 192 193 194 195 196 | |
DimensionalPowerLawBubbleParams
dataclass
Bases: DimensionalBaseBubbleParams
Source code in seaice3p/params/dimensional/bubble.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
maximum_bubble_radius_scaled
property
calculate the bubble radius divided by the pore scale
.. math:: \Lambda = R_B / R_0
minimum_bubble_radius_scaled
property
calculate the bubble radius divided by the pore scale
.. math:: \Lambda = R_B / R_0
DimensionalRobinForcing
dataclass
This forcing imposes a Robin boundary condition of the form surface_heat_flux=heat_transfer_coefficient * (restoring_temp - surface_temp)
Source code in seaice3p/params/dimensional/forcing.py
164 165 166 167 168 169 170 171 172 | |
DimensionalWaterParams
dataclass
Source code in seaice3p/params/dimensional/water.py
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 | |
concentration_ratio
property
Calculate concentration ratio as
.. math:: \mathcal{C} = S_i / \Delta S
conductivity_ratio
property
Calculate the ratio of solid to liquid thermal conductivity
.. math:: \lambda = \frac{k_s}{k_l}
eddy_diffusivity_ratio
property
Calculate the ratio of eddy diffusivity to thermal diffusivity in the liquid phase
.. math:: \lambda = \frac{\kappa_\text{turbulent}}{\kappa_l}
lewis_salt
property
Calculate the lewis number for salt, return np.inf if there is no salt diffusion.
.. math:: \text{Le}_S = \kappa / D_s
ocean_freezing_temperature
property
calculate salinity dependent freezing temperature using linear liquidus with ocean salinity
.. math:: T_i = T_L(S_i) = T_E S_i / S_E
or using a cubic fit for the liquidus curve
salinity_difference
property
calculate difference between eutectic salinity and typical ocean salinity
.. math:: \Delta S = S_E - S_i
snow_conductivity_ratio
property
Calculate the ratio of snow to liquid thermal conductivity
.. math:: \lambda = \frac{k_{sn}}{k_l}
specific_heat_ratio
property
Calculate the ratio of solid to liquid specific heat capacities
.. math:: \lambda = \frac{c_{p,s}}{c_{p,l}}
stefan_number
property
calculate Stefan number
.. math:: \text{St} = L / c_p \Delta T
temperature_difference
property
calculate
.. math:: \Delta T = T_i - T_E
thermal_diffusivity
property
Return thermal diffusivity in m2/s
.. math:: \kappa = \frac{k}{\rho_l c_p}
NoBrineConvection
dataclass
No brine convection
Source code in seaice3p/params/dimensional/convection.py
5 6 7 8 | |
NumericalParams
dataclass
parameters needed for discretisation and choice of numerical method
Source code in seaice3p/params/dimensional/numerical.py
5 6 7 8 9 10 11 12 13 14 15 16 | |
UniformInitialConditions
dataclass
values for bottom (ocean) boundary
Source code in seaice3p/params/dimensional/initial_conditions.py
6 7 8 9 | |
bubble
BaseBubbleParams
dataclass
Not to be used directly but provides parameters for bubble model in sea ice common to other bubble parameter objects.
Source code in seaice3p/params/bubble.py
10 11 12 13 14 15 16 17 18 19 20 21 | |
MonoBubbleParams
dataclass
Bases: BaseBubbleParams
Parameters for population of identical spherical bubbles.
Source code in seaice3p/params/bubble.py
24 25 26 27 28 29 | |
PowerLawBubbleParams
dataclass
Bases: BaseBubbleParams
Parameters for population of bubbles following a power law size distribution between a minimum and maximum radius.
Source code in seaice3p/params/bubble.py
32 33 34 35 36 37 38 39 40 41 | |
convection
RJW14Params
dataclass
Parameters for the RJW14 parameterisation of brine convection
Source code in seaice3p/params/convection.py
6 7 8 9 10 11 12 13 14 15 16 | |
convert
Scales
dataclass
Source code in seaice3p/params/convert.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 | |
time_scale
property
in days
velocity_scale
property
in m /day
convert_dimensional_bulk_air_to_argon_content(dimensional_bulk_gas)
Convert kg/m3 of air to micromole of Argon per Liter of ice
Source code in seaice3p/params/convert.py
81 82 83 84 85 86 87 88 89 90 91 | |
convert_from_dimensional_bulk_gas(dimensional_bulk_gas)
Non dimensionalise bulk gas content in kg/m3
Source code in seaice3p/params/convert.py
73 74 75 | |
convert_from_dimensional_bulk_salinity(dimensional_bulk_salinity)
Non dimensionalise bulk salinity in g/kg
Source code in seaice3p/params/convert.py
63 64 65 66 67 | |
convert_from_dimensional_dissolved_gas(dimensional_dissolved_gas)
convert from dissolved gas in kg(gas)/kg(liquid) to dimensionless
Source code in seaice3p/params/convert.py
93 94 95 | |
convert_from_dimensional_grid(dimensional_grid)
Non dimensionalise domain depths in meters
Source code in seaice3p/params/convert.py
47 48 49 | |
convert_from_dimensional_heat_flux(dimensional_heat_flux)
convert from heat flux in W/m2 to dimensionless units
Source code in seaice3p/params/convert.py
110 111 112 113 114 115 116 | |
convert_from_dimensional_heating(dimensional_heating)
convert from heating rate in W/m3 to dimensionless units
Source code in seaice3p/params/convert.py
102 103 104 105 106 107 108 | |
convert_from_dimensional_temperature(dimensional_temperature)
Non dimensionalise temperature in deg C
Source code in seaice3p/params/convert.py
35 36 37 38 39 | |
convert_from_dimensional_time(dimensional_time)
Non dimensionalise time in days
Source code in seaice3p/params/convert.py
55 56 57 | |
convert_to_dimensional_bulk_gas(bulk_gas)
Convert dimensionless bulk gas content to kg/m3
Source code in seaice3p/params/convert.py
77 78 79 | |
convert_to_dimensional_bulk_salinity(bulk_salinity)
Convert non dimensional bulk salinity to g/kg
Source code in seaice3p/params/convert.py
69 70 71 | |
convert_to_dimensional_dissolved_gas(dissolved_gas)
convert from non dimensional dissolved gas to dimensional dissolved gas in kg(gas)/kg(liquid)
Source code in seaice3p/params/convert.py
97 98 99 100 | |
convert_to_dimensional_grid(grid)
Get domain depths in meters from non dimensional values
Source code in seaice3p/params/convert.py
51 52 53 | |
convert_to_dimensional_heat_flux(heat_flux)
convert from dimensionless heat flux to heat flux in W/m2
Source code in seaice3p/params/convert.py
118 119 120 121 122 123 124 | |
convert_to_dimensional_temperature(temperature)
get temperature in deg C from non dimensional temperature
Source code in seaice3p/params/convert.py
41 42 43 44 45 | |
convert_to_dimensional_time(time)
Convert non dimensional time into time in days since start of simulation
Source code in seaice3p/params/convert.py
59 60 61 | |
dimensional
bubble
DimensionalMonoBubbleParams
dataclass
Bases: DimensionalBaseBubbleParams
Source code in seaice3p/params/dimensional/bubble.py
15 16 17 18 19 20 21 22 23 24 25 26 27 | |
bubble_radius_scaled
property
calculate the bubble radius divided by the pore scale
.. math:: \Lambda = R_B / R_0
DimensionalPowerLawBubbleParams
dataclass
Bases: DimensionalBaseBubbleParams
Source code in seaice3p/params/dimensional/bubble.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
maximum_bubble_radius_scaled
property
calculate the bubble radius divided by the pore scale
.. math:: \Lambda = R_B / R_0
minimum_bubble_radius_scaled
property
calculate the bubble radius divided by the pore scale
.. math:: \Lambda = R_B / R_0
convection
NoBrineConvection
dataclass
No brine convection
Source code in seaice3p/params/dimensional/convection.py
5 6 7 8 | |
dimensional
Dimensional parameters required to run a simulation and convert output to dimensional variables.
The DimensionalParams class contains all the dimensional parameters needed to produce a simulation configuration.
The Scales class contains all the dimensional parameters required to convert simulation output between physical and non-dimensional variables.
DimensionalParams
dataclass
Contains all dimensional parameters needed to calculate non dimensional numbers.
To see the units each input should have look at the comment next to the default value.
Source code in seaice3p/params/dimensional/dimensional.py
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 | |
B
property
calculate the non dimensional scale for buoyant rise of gas bubbles as
.. math:: \mathcal{B} = \frac{\rho_l g R_0^2 h}{3 \mu \kappa}
Rayleigh_salt
property
Calculate the haline Rayleigh number as
.. math:: \text{Ra}_S = \frac{\rho_l g \beta \Delta S H K_0}{\kappa \mu}
damkohler_number
property
Return damkohler number as ratio of thermal timescale to nucleation timescale
expansion_coefficient
property
calculate
.. math:: \chi = \rho_l \xi_{\text{sat}} / \rho_g
frame_velocity
property
calculate the frame velocity in non dimensional units
lewis_gas
property
Calculate the lewis number for dissolved gas, return np.inf if there is no dissolved gas diffusion.
.. math:: \text{Le}\xi = \kappa / D\xi
savefreq
property
calculate the save frequency in non dimensional time
scales
property
return a Scales object used for converting between dimensional and non dimensional variables.
total_time
property
calculate the total time in non dimensional units for the simulation
load(path)
classmethod
load this object from a yaml configuration file.
Source code in seaice3p/params/dimensional/dimensional.py
198 199 200 201 202 203 | |
save(directory)
save this object to a yaml file in the specified directory.
The name will be the name given with _dimensional appended to distinguish it from a saved non-dimensional configuration.
Source code in seaice3p/params/dimensional/dimensional.py
190 191 192 193 194 195 196 | |
forcing
DimensionalConstantTurbulentFlux
dataclass
Parameters for calculating the turbulent surface sensible and latent heat fluxes
NOTE: If you are running a simulation with ERA5 reanalysis forcing you must set the ref_height=2m as this is the appropriate value for the atmospheric reanalysis quantities
The windspeed given here will only be used with ERA5 forcing if the windspeed key is set to None in the forcing_data_file_keys dictionary.
Source code in seaice3p/params/dimensional/forcing.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
DimensionalERA5Forcing
read ERA5 data from netCDF file located at data_path.
Simulation will take atmospheric forcings from the start date specified in the string format YYYY-MM-DD
forcing_data_file_keys is a mapping of the descriptive names of the forcing data to be provided to the simulationa and the values are the corresponding strings giving the name of that variable in the netCDF file. The default values are the ERA5 variable names and the SnowModel-LG snow depth name.
Note that if you pass "sd" for the snow depth the simulation will assume you have provided snow depth in m of water equivalent and you must provide a snow density for the conversion.
If you pass None for the snow depth the simulation will procede with no snow layer. If you pass None for the windspeed the simulation will use the constant windspeed defined in the turbulent flux forcing parameters.
Source code in seaice3p/params/dimensional/forcing.py
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 | |
DimensionalRobinForcing
dataclass
This forcing imposes a Robin boundary condition of the form surface_heat_flux=heat_transfer_coefficient * (restoring_temp - surface_temp)
Source code in seaice3p/params/dimensional/forcing.py
164 165 166 167 168 169 170 171 172 | |
initial_conditions
BRW09InitialConditions
dataclass
values for bottom (ocean) boundary
Source code in seaice3p/params/dimensional/initial_conditions.py
12 13 14 15 16 17 | |
UniformInitialConditions
dataclass
values for bottom (ocean) boundary
Source code in seaice3p/params/dimensional/initial_conditions.py
6 7 8 9 | |
numerical
NumericalParams
dataclass
parameters needed for discretisation and choice of numerical method
Source code in seaice3p/params/dimensional/numerical.py
5 6 7 8 9 10 11 12 13 14 15 16 | |
ocean_forcing
DimensionalBRW09OceanForcing
dataclass
Ocean temperature provided by Barrow 2009 data at 2.4m and specify ocean fixed gas saturation state
Source code in seaice3p/params/dimensional/ocean_forcing.py
56 57 58 59 60 61 62 | |
DimensionalFixedHeatFluxOceanForcing
dataclass
Provides constant ocean heat flux at the bottom of the domain
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ocean_heat_flux
|
float
|
The constant heat flux at the bottom of the domain in W/m2 |
1
|
Source code in seaice3p/params/dimensional/ocean_forcing.py
14 15 16 17 18 19 20 21 22 23 | |
DimensionalFixedTempOceanForcing
dataclass
Fixed temperature and gas saturation ocean boundary condition
Source code in seaice3p/params/dimensional/ocean_forcing.py
6 7 8 9 10 11 | |
DimensionalMonthlyHeatFluxOceanForcing
dataclass
Provides constant ocean heat flux at the bottom of the domain in each month
Proivde an average monthly ocean heat flux with the entries i=0, 1, 2, 3, ...., 11 in the tuple corresponding to the months January, February, March, April, ...., December
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
monthly_ocean_heat_flux
|
Tuple[float, ...]
|
Tuple of ocean heat flux values in each month in W/m2 |
(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
|
Source code in seaice3p/params/dimensional/ocean_forcing.py
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 | |
water
CubicLiquidus
dataclass
Cubic fit to liquidus to give liquidus salinity in terms of temperature
S = a0 + a1 T + a2 T^2 + a3 T^3
defaults are taken from Notz PhD thesis for fit to Assur seawater data
Source code in seaice3p/params/dimensional/water.py
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 | |
DimensionalWaterParams
dataclass
Source code in seaice3p/params/dimensional/water.py
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 | |
concentration_ratio
property
Calculate concentration ratio as
.. math:: \mathcal{C} = S_i / \Delta S
conductivity_ratio
property
Calculate the ratio of solid to liquid thermal conductivity
.. math:: \lambda = \frac{k_s}{k_l}
eddy_diffusivity_ratio
property
Calculate the ratio of eddy diffusivity to thermal diffusivity in the liquid phase
.. math:: \lambda = \frac{\kappa_\text{turbulent}}{\kappa_l}
lewis_salt
property
Calculate the lewis number for salt, return np.inf if there is no salt diffusion.
.. math:: \text{Le}_S = \kappa / D_s
ocean_freezing_temperature
property
calculate salinity dependent freezing temperature using linear liquidus with ocean salinity
.. math:: T_i = T_L(S_i) = T_E S_i / S_E
or using a cubic fit for the liquidus curve
salinity_difference
property
calculate difference between eutectic salinity and typical ocean salinity
.. math:: \Delta S = S_E - S_i
snow_conductivity_ratio
property
Calculate the ratio of snow to liquid thermal conductivity
.. math:: \lambda = \frac{k_{sn}}{k_l}
specific_heat_ratio
property
Calculate the ratio of solid to liquid specific heat capacities
.. math:: \lambda = \frac{c_{p,s}}{c_{p,l}}
stefan_number
property
calculate Stefan number
.. math:: \text{St} = L / c_p \Delta T
temperature_difference
property
calculate
.. math:: \Delta T = T_i - T_E
thermal_diffusivity
property
Return thermal diffusivity in m2/s
.. math:: \kappa = \frac{k}{\rho_l c_p}
forcing
BRW09Forcing
Surface and ocean temperature data loaded from thermistor temperature record during the Barrow 2009 field study.
Source code in seaice3p/params/forcing.py
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 | |
__post_init__()
populate class attributes with barrow dimensional air temperature and time in days (with missing values filtered out).
Note the metadata explaining how to use the barrow temperature data is also in seaice3p/forcing_data. The indices corresponding to days and air temp are hard coded in as class variables.
Source code in seaice3p/params/forcing.py
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 | |
ConstantForcing
dataclass
Constant temperature forcing
Source code in seaice3p/params/forcing.py
37 38 39 40 41 42 | |
ERA5Forcing
Forcing parameters for simulation forced with atmospheric variables from reanalysis data in netCDF file located at data_path.
Never create this object directly but instead initialise from a dimensional simulation configuration as we must pass it the simulation timescale to correctly read the atmospheric variables from the netCDF file.
Source code in seaice3p/params/forcing.py
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 | |
RadForcing
dataclass
Forcing parameters for radiative transfer simulation with oil drops
we have not implemented the non-dimensionalisation for these parameters yet and so we just pass the dimensional values directly to the simulation
Source code in seaice3p/params/forcing.py
93 94 95 96 97 98 99 100 101 102 103 104 | |
RobinForcing
dataclass
Dimensionless forcing parameters for Robin boundary condition
Source code in seaice3p/params/forcing.py
221 222 223 224 225 226 227 | |
YearlyForcing
dataclass
Yearly sinusoidal temperature forcing
Source code in seaice3p/params/forcing.py
45 46 47 48 49 50 51 52 | |
_calculate_specific_humidity(pressure, dewpoint)
Take ERA5 data and return specific humidity at 2m in kg/kg
Source code in seaice3p/params/forcing.py
210 211 212 213 214 215 216 217 218 | |
_filter_missing_values(air_temp, days)
Filter out missing values are recorded as 9999
Source code in seaice3p/params/forcing.py
31 32 33 34 | |
initial_conditions
OilInitialConditions
dataclass
values for bottom (ocean) boundary
Source code in seaice3p/params/initial_conditions.py
12 13 14 15 16 17 18 19 20 21 22 23 | |
ocean_forcing
BRW09OceanForcing
Ocean temperature provided by Barrow 2009 data at 2.4m and specify ocean fixed gas saturation state
Source code in seaice3p/params/ocean_forcing.py
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 | |
__post_init__()
populate class attributes with barrow dimensional ocean temperature and time in days (with missing values filtered out).
Note the metadata explaining how to use the barrow temperature data is also in seaice3p/forcing_data.
Source code in seaice3p/params/ocean_forcing.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
FixedHeatFluxOceanForcing
dataclass
Provides constant dimensionless ocean heat flux at the bottom of the domain and fixed gas saturation state.
Source code in seaice3p/params/ocean_forcing.py
27 28 29 30 31 32 33 34 | |
FixedTempOceanForcing
dataclass
Fixed temperature and gas saturation ocean boundary condition
Source code in seaice3p/params/ocean_forcing.py
18 19 20 21 22 23 24 | |
MonthlyHeatFluxOceanForcing
Provides constant dimensionless ocean heat flux at the bottom of the domain in each month
and ocean gas saturation state.
Proivde an average monthly ocean heat flux with the entries i=0, 1, 2, 3, ...., 11 in the tuple corresponding to the months January, February, March, April, ...., December
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
monthly_ocean_heat_flux
|
Tuple of dimensionless ocean heat flux values in |
required |
Source code in seaice3p/params/ocean_forcing.py
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 | |
params
Classes containing parameters required to run a simulation
The config class contains all the parameters needed to run a simulation as well as methods to save and load this configuration to a yaml file.
Config
dataclass
contains all information needed to run a simulation and save output
this config object can be saved and loaded to a yaml file.
Source code in seaice3p/params/params.py
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 | |
get_config(dimensional_params)
Return a Config object for the simulation.
physical parameters and Darcy law parameters are calculated from the dimensional input. You can modify the numerical parameters and boundary conditions and forcing provided for the simulation.
Source code in seaice3p/params/params.py
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 | |
physical
BasePhysicalParams
dataclass
Not to be used directly but provides the common parameters for physical params objects
Source code in seaice3p/params/physical.py
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 | |
DISEQPhysicalParams
dataclass
Bases: BasePhysicalParams
non dimensional numbers for the mushy layer
Source code in seaice3p/params/physical.py
50 51 52 53 54 55 56 | |
EQMPhysicalParams
dataclass
Bases: BasePhysicalParams
non dimensional numbers for the mushy layer
Source code in seaice3p/params/physical.py
44 45 46 47 | |
plot
script to visualise simulation data
usage: python -m seaice3p.plot "glob pattern to find npz files" Optional[True/False]
assumes the simulation configurations are to be found in the same directory as the data. If the simulation is a non-dimensional configuration file add the False option after the glob pattern.
run_simulation
Module to run the simulation on the given configuration with the appropriate solver.
Solve reduced model using scipy solve_ivp using RK23 solver.
Impose a maximum timestep constraint using courant number for thermal diffusion as this is an explicit method.
This solver uses adaptive timestepping which makes it a good choice for running simulations with large buoyancy driven gas bubble velocities and we save the output at intervals given by the savefreq parameter in configuration.
run_batch(list_of_cfg, directory, verbosity_level=0)
Run a batch of simulations from a list of configurations.
Each simulation name is logged, as well as if it successfully runs or crashes. Output from each simulation is saved in a .npz file.
:param list_of_cfg: list of configurations :type list_of_cfg: List[seaice3p.params.Config]
Source code in seaice3p/run_simulation.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
state
disequilibrium_state
DISEQState
dataclass
Contains the principal variables for solution with non-equilibrium gas phase. The total bulk gas is partitioned between dissolved gas and free phase gas with a finite nucleation rate (non dimensional damkohler number).
principal solution components: bulk enthalpy bulk salinity bulk dissolved gas gas fraction
all on the center grid.
Note: Define bulk dissolved gas for the system as
expansion_coefficient * liquid_fraction * dissolved_gas
so that this is different from the dissolved gas concentration and
bulk_gas = bulk_dissolved_gas + gas_fraction
in non-dimensional units.
Source code in seaice3p/state/disequilibrium_state.py
6 7 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 | |
gas
cached
property
Calculate bulk gas content and use same attribute name as EQMState
DISEQStateBCs
dataclass
Stores information needed for solution at one timestep with BCs on ghost cells as well
Initialiase the prime variables for the solver: enthalpy, bulk salinity and bulk air
Source code in seaice3p/state/disequilibrium_state.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
DISEQStateFull
dataclass
Contains all variables variables for solution with non-equilibrium gas phase after running the enthalpy method on DISEQSate. The total bulk gas is partitioned between dissolved gas and free phase gas with a finite nucleation rate (non dimensional damkohler number).
principal solution components: bulk enthalpy bulk salinity bulk dissolved gas gas fraction
enthalpy method variables: temperature liquid_fraction solid_fraction liquid_salinity dissolved_gas
all on the center grid.
Note: Define bulk dissolved gas for the system as
expansion_coefficient * liquid_fraction * dissolved_gas
so that this is different from the dissolved gas concentration and
bulk_gas = bulk_dissolved_gas + gas_fraction
in non-dimensional units.
Source code in seaice3p/state/disequilibrium_state.py
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 | |
gas
cached
property
Calculate bulk gas content and use same attribute name as EQMState
equilibrium_state
EQMState
dataclass
Contains the principal variables for solution with equilibrium gas phase:
bulk enthalpy bulk salinity bulk gas
all on the center grid.
Source code in seaice3p/state/equilibrium_state.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
EQMStateBCs
dataclass
Stores information needed for solution at one timestep with BCs on ghost cells as well
Initialiase the prime variables for the solver: enthalpy, bulk salinity and bulk air
Source code in seaice3p/state/equilibrium_state.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
EQMStateFull
dataclass
Contains all variables variables for solution with equilibrium gas phase after running the enthalpy method on EQMSate.
principal solution components: bulk enthalpy bulk salinity bulk gas
enthalpy method variables: temperature liquid_fraction solid_fraction liquid_salinity dissolved_gas gas_fraction
all on the center grid.
Source code in seaice3p/state/equilibrium_state.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 51 52 53 54 | |