CoolDwarf.star.atmo package¶
Submodules¶
CoolDwarf.star.atmo.atmo module¶
- class CoolDwarf.star.atmo.atmo.AdiabaticIdealAtmosphere(structure: VoxelSphere, opac, radialResolution: int = 10, azimuthalResolution: int = 10, altitudinalResolution: int = 10, tol: Dict[str, float] = {'maxEChange': 0.0001, 'relax': 1e-06, 'volCheck': 0.01}, dof: int = 5, Omega: float = 0)¶
Bases:
object
- Attributes:
- density
- f
- geostrophic_wind_velocity_field
- gradP
- k
lapT
Find the laplacian of the temperature field.
- pressure
- temperature
Methods
gradT
([order, zThresh, corr])Computes the temperature gradients in the radial, azimuthal, and altitudinal directions.
Calculate the change in temperature over some timestep, dt. The change in temperature is given by the following equation: .. math:: Delta T = lambda_{D} - lambda_{A} + lambda_{R}.
adiabatic_loss
advective_loss
density_profile
diffusive_loss
inject_energy
pressure_profile
radiative_loss
temperature_profile
timestep
- adiabatic_loss() float ¶
- advective_loss()¶
- property density: ndarray[Any, dtype[float64]]¶
- density_profile(r: float | ndarray[Any, dtype[float64]]) float | ndarray[Any, dtype[float64]] ¶
- diffusive_loss()¶
- property f: ndarray[Any, dtype[float64]]¶
- property geostrophic_wind_velocity_field: Tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]]¶
- property gradP: Tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]]¶
- gradT(order: int = 1, zThresh: float = 1e-08, corr: bool = True) Tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]] ¶
Computes the temperature gradients in the radial, azimuthal, and altitudinal directions.
- Parameters:
- orderint, default=1
The order of the derivative.
- zThreshfloat, default=1e-8
The threshold value for the temperature gradient. If the absolute value of the gradient is less than zThresh, it is set to 0.
- coorbool, default=True
If True, the temperature gradient is computed in spherical coordinates. If False, the gradient is computed in cartesian coordinates. More formally, if true then the gradient is computed as:
\[\nabla T = (\partial_r T, \frac{1}{r} \partial_{\theta} T, \frac{1}{r \sin(\phi)} \partial_{\phi} T)\]If false, the gradient is computed as:
\[\nabla T = (\partial_x T, \partial_y T, \partial_z T)\]A similar pattern is carried over to the laplacian.
- Returns:
- tuple: A tuple of 3D arrays representing the temperature gradients in the radial, azimuthal, and altitudinal directions.
- The arrays are in the form of (tGradR, tGradTheta, tGradPhi).
- Raises:
- TypeError
If order is not an integer
- ValueError
If order is less than 1.
- inject_energy(theta, phi, r, energy)¶
- property k¶
- property lapT: Tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]]¶
Find the laplacian of the temperature field. This is simply a wrapper around 2nd order gradient
- Parameters:
- corrbool, default=True
If True, the laplacian is computed in spherical coordinates. If False, the laplacian is computed in cartesian coordinates.
- Returns:
- lapTNDArray[np.float64]
The laplacian of the temperature field.
- property pressure: ndarray[Any, dtype[float64]]¶
- pressure_profile(r: float | ndarray[Any, dtype[float64]]) float | ndarray[Any, dtype[float64]] ¶
- radiative_loss()¶
- property temperature: ndarray[Any, dtype[float64]]¶
- temperature_profile(r: float | ndarray[Any, dtype[float64]]) float | ndarray[Any, dtype[float64]] ¶
- timestep(dt: float)¶
- timestep_temperature(dt: float)¶
Calculate the change in temperature over some timestep, dt. The change in temperature is given by the following equation:
\[\Delta T = \lambda_{D} - \lambda_{A} + \lambda_{R}\]Where \(\lambda_{D}\) is the diffusive loss, \(\lambda_{A}\) is the advective loss, and \(\lambda_{R}\) is the radiative loss.
- Parameters:
- dtfloat
The timestep to calculate the change in temperature over.
- Returns:
- deltaTfloat
The change in temperature over the timestep, dt.