|
22 | 22 | from . import _helpers, _step, conf, error, phyvars, stagyyparsers |
23 | 23 | from ._step import Step |
24 | 24 | from .datatypes import Rprof, Tseries, Vart |
| 25 | +from .dimensions import Scales |
25 | 26 | from .parfile import StagyyPar |
26 | 27 | from .stagyyparsers import FieldXmf, TracersXmf |
27 | 28 |
|
@@ -73,94 +74,6 @@ def _as_view_item( |
73 | 74 | return None |
74 | 75 |
|
75 | 76 |
|
76 | | -class _Scales: |
77 | | - """Dimensional scales. |
78 | | -
|
79 | | - Args: |
80 | | - sdat: the StagyyData instance owning the :class:`_Scales` instance. |
81 | | - """ |
82 | | - |
83 | | - def __init__(self, sdat: StagyyData): |
84 | | - self._sdat = sdat |
85 | | - |
86 | | - @property |
87 | | - def par(self) -> StagyyPar: |
88 | | - return self._sdat.par |
89 | | - |
90 | | - @cached_property |
91 | | - def length(self) -> float: |
92 | | - """Length in m.""" |
93 | | - thick = self.par.get("geometry", "d_dimensional", 2890e3) |
94 | | - if self.par.get("boundaries", "air_layer", False): |
95 | | - thick += self.par.nml["boundaries"]["air_thickness"] |
96 | | - return thick |
97 | | - |
98 | | - @property |
99 | | - def temperature(self) -> float: |
100 | | - """Temperature in K.""" |
101 | | - return self.par.nml["refstate"]["deltaT_dimensional"] |
102 | | - |
103 | | - @property |
104 | | - def density(self) -> float: |
105 | | - """Density in kg/m3.""" |
106 | | - return self.par.nml["refstate"]["dens_dimensional"] |
107 | | - |
108 | | - @property |
109 | | - def th_cond(self) -> float: |
110 | | - """Thermal conductivity in W/(m.K).""" |
111 | | - return self.par.nml["refstate"]["tcond_dimensional"] |
112 | | - |
113 | | - @property |
114 | | - def sp_heat(self) -> float: |
115 | | - """Specific heat capacity in J/(kg.K).""" |
116 | | - return self.par.nml["refstate"]["Cp_dimensional"] |
117 | | - |
118 | | - @property |
119 | | - def dyn_visc(self) -> float: |
120 | | - """Dynamic viscosity in Pa.s.""" |
121 | | - return self.par.nml["viscosity"]["eta0"] |
122 | | - |
123 | | - @property |
124 | | - def th_diff(self) -> float: |
125 | | - """Thermal diffusivity in m2/s.""" |
126 | | - return self.th_cond / (self.density * self.sp_heat) |
127 | | - |
128 | | - @property |
129 | | - def time(self) -> float: |
130 | | - """Time in s.""" |
131 | | - return self.length**2 / self.th_diff |
132 | | - |
133 | | - @property |
134 | | - def velocity(self) -> float: |
135 | | - """Velocity in m/s.""" |
136 | | - return self.length / self.time |
137 | | - |
138 | | - @property |
139 | | - def acceleration(self) -> float: |
140 | | - """Acceleration in m/s2.""" |
141 | | - return self.length / self.time**2 |
142 | | - |
143 | | - @property |
144 | | - def power(self) -> float: |
145 | | - """Power in W.""" |
146 | | - return self.th_cond * self.temperature * self.length |
147 | | - |
148 | | - @property |
149 | | - def heat_flux(self) -> float: |
150 | | - """Local heat flux in W/m2.""" |
151 | | - return self.power / self.length**2 |
152 | | - |
153 | | - @property |
154 | | - def heat_production(self) -> float: |
155 | | - """Local heat production in W/m3.""" |
156 | | - return self.power / self.length**3 |
157 | | - |
158 | | - @property |
159 | | - def stress(self) -> float: |
160 | | - """Stress in Pa.""" |
161 | | - return self.dyn_visc / self.time |
162 | | - |
163 | | - |
164 | 77 | class _Refstate: |
165 | 78 | """Reference state profiles. |
166 | 79 |
|
@@ -765,7 +678,7 @@ def __init__(self, path: PathLike): |
765 | 678 | self._parpath = Path(path) |
766 | 679 | if not self._parpath.is_file(): |
767 | 680 | self._parpath /= "par" |
768 | | - self.scales = _Scales(self) |
| 681 | + self.scales = Scales(self) |
769 | 682 | self.refstate = _Refstate(self) |
770 | 683 | self.tseries = _Tseries(self) |
771 | 684 | self.steps = _Steps(self) |
|
0 commit comments