Skip to content

Commit f22081d

Browse files
committed
New velocity, acceleration, heat_production scales
1 parent 4399f49 commit f22081d

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

stagpy/phyvars.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,11 @@
281281
's': attrgetter('time'),
282282
'W/(m.K)': attrgetter('th_cond'),
283283
'm2/s': attrgetter('th_diff'),
284-
'W/m3': lambda scl: scl.power / scl.length**3,
284+
'W/m3': attrgetter('heat_production'),
285285
'1/s': lambda scl: 1 / scl.time,
286286
'K/s': lambda scl: scl.temperature / scl.time,
287-
'm/s': lambda scl: scl.length / scl.time,
288-
'm/s2': lambda scl: scl.length / scl.time**2,
287+
'm/s': attrgetter('velocity'),
288+
'm/s2': attrgetter('acceleration'),
289289
})
290290

291291
PREFIXES = ('k', 'M', 'G')

stagpy/stagyydata.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,16 @@ def time(self) -> float:
109109
"""Time in s."""
110110
return self.length**2 / self.th_diff
111111

112+
@property
113+
def velocity(self) -> float:
114+
"""Velocity in m/s."""
115+
return self.length / self.time
116+
117+
@property
118+
def acceleration(self) -> float:
119+
"""Acceleration in m/s2."""
120+
return self.length / self.time**2
121+
112122
@property
113123
def power(self) -> float:
114124
"""Power in W."""
@@ -119,6 +129,11 @@ def heat_flux(self) -> float:
119129
"""Local heat flux in W/m2."""
120130
return self.power / self.length**2
121131

132+
@property
133+
def heat_production(self) -> float:
134+
"""Local heat production in W/m3."""
135+
return self.power / self.length**3
136+
122137
@property
123138
def stress(self) -> float:
124139
"""Stress in Pa."""

0 commit comments

Comments
 (0)