TidalPy.structures.layers package

Submodules

TidalPy.structures.layers.basic module

class TidalPy.structures.layers.basic.LayerBase[source]

Bases: PhysicalObjSpherical

Layer object to store parameters geometric and physical properties calculated by TidalPy based on a user-provided

configuration dictionary.

Notes: .. Does not provide any functionality to perform tidal calculations (see PhysicsLayer instead)

See also

TidalPy.structures.layers.PhysicsLayer, TidalPy.structures.layers.GasLayer

clear_state(clear_pressure: bool = False)[source]

Clear all state properties to None.

Purposefully avoid clearing things set during initialization: This should not clear configurations, methods,

or loaded functions. Instead it will reset properties like temperature, pressure, orbital frequency, etc.

property density: float

State density of the layer

property gravity: float

State gravity of the layer

internal_thermal_equilibrium_changed()[source]

The internal heating / cooling of the layer has changed. Make any necessary updates.

property is_tidal: bool

Flag if layer is tidally active

property is_top_layer: bool

Flag for if this layer is the top-most layer inside of <layer>.world

property layer_above: 'LayerType' | NoneType

The layer instance above this one in a world

property layer_below: 'LayerType' | NoneType

The layer instance below this one in a world

layer_class = 'base'
property layer_index: int

Index of where the layer is inside of <layer>.world

property name: str

Name of the layer

property pressure: FloatArray

Dynamic layer pressure (taken to be at the interpolation point) [Pa]

reinit(initial_init: bool = False, initialize_geometry: bool = True)[source]

Reinitialize the physical object by pulling in any potentially new configurations

Parameters:
  • initial_init (bool = False) – Set to True for the first time an instance is created.

  • initialize_geometry (bool = False) – Set to True if the set_geometry method should be called from within reinit

set_geometry(radius: float, mass: float, thickness: float = None, mass_below: float = None, update_state_geometry: bool = True, build_slices: bool = True)[source]

Calculates and sets the layer’s physical parameters based on user provided input.

Assumptions

Spherical Geometry

param radius:

Outer radius of object [m]

type radius:

float

param mass:

Mass of object [kg]

type mass:

float

param thickness:

Thickness of the object [m]

type thickness:

float = None

param mass_below:

NOT USED: Left here to keep the method’s signature the same as its parents. The method will determine for itself what the mass below is based on self.layer_below which is a wrapper

to the layer’s world class.

Mass below this object (only applicable for shell-like structures) Used in gravity and pressure calculations

type mass_below:

float = None

param update_state_geometry:

Update the class’ state geometry

type update_state_geometry:

bool = True

param build_slices:

If True, method will attempt to calculate gravities, densities, etc. for each slice.

type build_slices:

bool = False

set_pressure(pressure: FloatArray, call_updates: bool = True)[source]

Set the layer’s dynamic pressure

Parameters:
  • pressure (FloatArray) – New dynamic pressure for the layer.

  • call_updates (bool = True) – If True, method will call the update thermals method.

set_state(temperature: FloatArray = None, pressure: FloatArray = None)[source]

Set the layer’s state properties

Parameters:
  • temperature (FloatArray = None) – New dynamic temperature for the layer [K].

  • pressure (FloatArray = None) – New dynamic pressure for the layer [Pa].

set_temperature(temperature: FloatArray, call_updates: bool = True)[source]

Set the layer’s dynamic temperature

Parameters:
  • temperature (FloatArray) – New dynamic temperature for the layer.

  • call_updates (bool = True) – If True, method will call the update thermals method.

strength_changed()[source]

The viscosity and/or shear modulus of the layer has changed. Make any necessary updates.

property surface_temperature

The temperature at the top of this layer

surface_temperature_changed(called_from_cooling: bool = False)[source]

Surface temperature has changed - Perform any calculations that may have also changed.

Parameters:

called_from_cooling (bool = False) – Flag to avoid recursive loops between surface temperature and cooling.

property temperature: FloatArray

Dynamic layer temperature (taken to be at the interpolation point) [K]

temperature_pressure_changed()[source]

The temperature and/or pressure of the layer has changed. Make any necessary updates.

tidal_frequencies_changed(collapse_tidal_modes: bool = True)[source]

The tidal frequencies have changed. Make any necessary updates.

Parameters:

collapse_tidal_modes (bool = True) – If True, then the world will tell its tides model to collapse tidal modes.

property time

Time property used for radiogenic calculations [Myr]

Stored in <world>.time

time_changed()[source]

The time has changed. Make any necessary updates.

property use_bulk_density: bool

Flag if layer uses the bulk or central density for calculations (only matters for burnman layers)

property use_surf_gravity: bool

Flag if layer uses the surface or central gravity for calculations

property use_tidal_vol_frac: bool

Flag if layer uses tidal volume fraction

property world: LayeredWorldType

The world class where this layer was initialized

TidalPy.structures.layers.gas module

class TidalPy.structures.layers.gas.GasLayer(layer_name: str, layer_index: int, world: GasGiantLayeredWorld, layer_config: dict, is_top_layer: bool, initialize: bool = True)[source]

Bases: LayerBase

“ GasLayer Layer object used to construct gas giant or ice giant planets that contain a significant gas layer. Currently,

these layers do not do anything over the base layer class but allow for future functionality.

Notes: .. Does not provide any functionality to perform tidal calculations (see PhysicsLayer instead)

See also

TidalPy.structures.layers.LayerBase

layer_class = 'gas'

TidalPy.structures.layers.helper module

TidalPy.structures.layers.helper.find_geometry_from_config(config: dict, layer_index: int, is_top_layer: bool, world_radius: float, world_mass: float, layer_below_radius: float | NoneType = None)[source]

Parse a configuration dictionary for geometry information

Parameters:
  • config (dict) – Object configuration dictionary.

  • layer_index (int) – Index of where the layer is inside a world.

  • is_top_layer (float) – If True, this layer is the top-most layer.

  • world_radius (float) – World’s radius [m]

  • world_mass (float) – World’s mass [kg]

  • layer_below_radius (Union[float, NoneType] = None) – The layer below this one’s radius [m]

Returns:

  • radius (float) – Object’s radius [m]

  • thickness (float) – Object’s thickness [m]

  • volume (float) – Object’s volume [m3]

  • mass (float) – Object’s mass [kg]

  • density (float) – Object’s density [kg m-3]

TidalPy.structures.layers.physics module

class TidalPy.structures.layers.physics.PhysicsLayer[source]

Bases: LayerBase

Layer object to store parameters geometric and physical properties calculated by TidalPy based on a user-provided

configuration dictionary. PhysicsLayer contains additional properties and methods used to perform various thermal and tidal calculations.

Notes: .. Should not be used with Burnman calculated layers (see BurnmanLayer instead)

See also

TidalPy.structures.layers.LayerBase, TidalPy.structures.layers.BurnmanLayer

property blt

Alias for PhysicsLayer.boundary_layer_thickness

property boundary_layer_thickness

Layer’s Thermal Boundary Layer Thickness [m]

Wrapper for <layer>.cooling_model.boundary_layer_thickness

Notes

Cooling module determines if the layer is convecting or conduction (depending on user-provided configurations). If the layer is set to only conduct, then the boundary layer thickness = 0.5 layer thickness.

calc_temperature_derivative(force_calculation: bool = False) FloatArray[source]

Calculate the change in temperature within this layer over time.

\[dT / dt = (Q_{ ext{In} } - Q_{ ext{Out} }) / (M * c_{ ext{p} } * ( ext{St} + 1) * T_{r}\]
Parameters:

force_calculation (bool = False) –

If True, then the method will raise any errors encountered. Otherwise method will ignore errors

but the temperature_time_derivative will likely not be set.

Returns:

dT/dt – The derivative of temperature with respect to time [K s-1].

Return type:

FloatArray

clear_state(clear_pressure: bool = False)[source]

Clear all state properties to None.

Purposefully avoid clearing things set during initialization: This should not clear configurations, methods,

or loaded functions. Instead it will reset properties like temperature, pressure, orbital frequency, etc.

property complex_compliances

Complex Shear Compliance of the Layer [Pa-1]

This is a complex number which includes information on the layer’s ability to dissipate shear energy.

Wrapper for <layer>.rheology.complex_compliances

complex_compliances_changed(collapse_tidal_modes: bool = True)[source]

The complex compliances have changed. Make any necessary updates.

Parameters:

collapse_tidal_modes (bool = True) – If True, then the world will tell its tides model to collapse tidal modes.

property compliance

Shear Compliance (Inverse of Shear Rigidity) of the Layer [Pa-1]

Wrapper for <layer>.rheology.postmelt_compliance

property cooling

Layer Cooling Rate [W]

Wrapper for <layer>.cooling_model.cooling

Notes

Cooling module determines if the layer is convecting or conduction (depending on user-provided configurations).

property cooling_flux

Layer Cooling Flux [W m-2]

Wrapper for <layer>.cooling_model.cooling_flux

Notes

Cooling module determines if the layer is convecting or conduction (depending on user-provided configurations).

property cooling_model: CoolingModel

Cooling class instance, used to calculate cooling rates

geotherm(avg_temperature: float = None)[source]

Calculates layer’s geotherm based on an average temperature (or layer’s current temperature)

Returns:

temperature_profile – numpy array of the adiabatic temperature profile

Return type:

np.ndarray

internal_thermal_equilibrium_changed(called_from_cooling: bool = False)[source]

The internal heating / cooling of the layer has changed. Make any necessary updates.

Parameters:

called_from_cooling (bool = False) – Flag to avoid recursive loops between surface temperature and cooling.

layer_class = 'physics'
property liquid_viscosity

Liquid Viscosity of the Layer [Pa s]

Wrapper for <layer>.rheology.liquid_viscosity

property melt_fraction

Melt Fraction of the Layer

Wrapper for <layer>.rheology.melt_fraction

property nusselt: ndarray

Layer’s Thermal Nusselt Number

Wrapper for <layer>.cooling_model.nusselt

Notes

Cooling module determines if the layer is convecting or conduction (depending on user-provided configurations). If the layer is not convecting then the Nusselt number will be 1

property radiogenic_heating

Radiogenic Heating Rate [W]

Wrapper for <layer>.radiogenics.heating

Notes: Calculated at the <world>.time (or, equivalently, <layer>.time)

property radiogenics: Radiogenics

Radiogenics class instance, used to calculate radiogenic heating based on the current time

property rayleigh

Layer’s Thermal Rayleigh Number

Wrapper for <layer>.cooling_model.rayleigh

Notes

Cooling module determines if the layer is convecting or conduction (depending on user-provided configurations). If the layer is not convecting then the Rayleigh number will be 0

reinit(initial_init: bool = False, initialize_geometry: bool = True)[source]

Reinitialize the physical object by pulling in any potentially new configurations

Parameters:
  • initial_init (bool = False) – Set to True for the first time an instance is created.

  • initialize_geometry (bool = False) – Set to True if the set_geometry method should be called from within reinit

property rheology: Rheology

Rheology class instance, used to calculate viscosity, rigidity, partial melting, and complex compliance

set_state(temperature: FloatArray = None, pressure: FloatArray = None, viscosity: FloatArray = None, shear_modulus: FloatArray = None)[source]

Set the layer’s state properties

Parameters:
  • temperature (FloatArray = None) – New dynamic temperature for the layer [K].

  • pressure (FloatArray = None) – New dynamic pressure for the layer [Pa].

  • viscosity (FloatArray = None) – The new viscosity of the layer in [Pa s]

  • shear_modulus (FloatArray = None) – The new shear modulus of the layer in [Pa]

set_strength(viscosity: FloatArray = None, shear_modulus: FloatArray = None)[source]

Manual set the viscosity and shear modulus of the layer, independent of temperature.

This method by-passes the self.viscosity_func and allows the user to manually set the viscosity and shear of the layer.

Future : TODO

Currently it does not change the layer’s temperature. In the future an effective temperature can be

(optionally) calculated. Make sure to implement this at the Rheology class level.

param viscosity:

The new viscosity of the layer in [Pa s]

type viscosity:

FloatArray

param shear_modulus:

The new shear modulus of the layer in [Pa]

type shear_modulus:

FloatArray

property shear_modulus

Shear Modulus (Shear Rigidity) of the Layer [Pa]

Wrapper for <layer>.rheology.postmelt_shear_modulus

strength_changed()[source]

The viscosity and/or shear modulus of the layer has changed. Make any necessary updates.

surface_temperature_changed(called_from_cooling: bool = False)[source]

Surface temperature has changed - Perform any calculations that may have also changed.

Parameters:

called_from_cooling (bool = False) – Flag to avoid recursive loops between surface temperature and cooling.

temperature_pressure_changed()[source]

The temperature and/or pressure of the layer has changed. Make any necessary updates.

property temperature_time_derivative: FloatArray

Time Derivative of Temperature [K s-1]

tidal_frequencies_changed(collapse_tidal_modes: bool = True)[source]

The tidal frequencies have changed. Make any necessary updates.

Parameters:

collapse_tidal_modes (bool = True) – If True, then the world will tell its tides model to collapse tidal modes.

property tidal_heating

Layer’s Tidal Heating

Wrapper for <layer>.<world>.tides.tidal_heating_by_layer[self]

time_changed()[source]

The time has changed. Make any necessary updates.

update_cooling(force_update: bool = False)[source]

Calculate parameters related to cooling of the layer, be it convection or conduction

Using the self.cooling class and the current temperature and viscosity, this method will calculate convection

parameters. Some of these may be zeros if convection is forced off in the planet’s configuration.

By default this method will ignore parameter missing errors to avoid initialization errors. This behaviour

can be altered by the force_calculation flag.

Parameters: force_update : bool = False

If False, then any (expected) errors are raised during the cooling calculation will be ignored.

property use_pressure_in_strength_calc: bool

Flag for if pressure is used in viscosity and rigidity calculations

property viscosity

Solid Viscosity of the Layer [Pa s]

Wrapper for <layer>.rheology.postmelt_viscosity