Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Philip Elson
CARA
Commits
9b72d82c
Commit
9b72d82c
authored
Oct 20, 2020
by
markus
Browse files
add suggestion for ventilation class structure
parent
618fc312
Changes
1
Hide whitespace changes
Inline
Side-by-side
CARA/temporary_ventilation.py
0 → 100644
View file @
9b72d82c
from
dataclasses
import
dataclass
from
abc
import
abstractmethod
import
numpy
as
np
@
dataclass
(
frozen
=
True
)
class
Ventilation
:
@
abstractmethod
def
air_exchange
(
self
,
room
,
time
:
float
)
->
float
:
pass
@
dataclass
(
frozen
=
True
)
class
PeriodicWindow
(
Ventilation
):
period
:
int
duration
:
int
inside_temp
:
float
outside_temp
:
float
window_height
:
float
opening_length
:
float
cd_b
:
float
def
air_exchange
(
self
,
room
,
time
:
float
)
->
float
:
if
time
%
self
.
period
<
(
self
.
period
-
self
.
duration
):
return
0
return
((
3600
/
3
*
room
.
volume
)
*
self
.
cd_b
*
self
.
window_height
*
self
.
opening_length
*
np
.
sqrt
(
9.81
*
self
.
window_height
*
(
abs
(
self
.
inside_temp
-
self
.
outside_temp
))
/
self
.
outside_temp
))
@
dataclass
(
frozen
=
True
)
class
PeriodicHEPA
(
Ventilation
):
period
:
int
duration
:
int
q_air_mech
:
int
def
air_exchange
(
self
,
room
,
time
:
float
)
->
float
:
if
time
%
self
.
period
<
(
self
.
period
-
self
.
duration
):
return
0
return
self
.
q_air_mech
/
room
.
volume
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment