PySimultan 0.2__tar.gz → 0.2.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. {pysimultan-0.2 → pysimultan-0.2.1}/MANIFEST.in +2 -1
  2. {pysimultan-0.2/src/PySimultan.egg-info → pysimultan-0.2.1}/PKG-INFO +1 -1
  3. {pysimultan-0.2 → pysimultan-0.2.1}/pyproject.toml +1 -1
  4. {pysimultan-0.2 → pysimultan-0.2.1}/setup.py +2 -2
  5. {pysimultan-0.2 → pysimultan-0.2.1/src/PySimultan.egg-info}/PKG-INFO +1 -1
  6. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan.egg-info/SOURCES.txt +19 -1
  7. pysimultan-0.2.1/tests/test_calc_static_zone_temperature.py +0 -0
  8. pysimultan-0.2.1/tests/test_calculate_steady_state_temperature.py +512 -0
  9. pysimultan-0.2.1/tests/test_create_geometry.py +166 -0
  10. pysimultan-0.2.1/tests/test_files.py +109 -0
  11. pysimultan-0.2.1/tests/test_files_load.py +97 -0
  12. pysimultan-0.2.1/tests/test_load_geometry.py +148 -0
  13. pysimultan-0.2.1/tests/test_load_multi_values.py +17 -0
  14. pysimultan-0.2.1/tests/test_new_dll.py +24 -0
  15. pysimultan-0.2.1/tests/test_new_project_creation.py +25 -0
  16. pysimultan-0.2.1/tests/test_numeric_map.py +122 -0
  17. pysimultan-0.2.1/tests/test_pythonnet.py +2 -0
  18. pysimultan-0.2.1/tests/test_register_class.py +149 -0
  19. pysimultan-0.2.1/tests/test_set_attr_property.py +65 -0
  20. pysimultan-0.2.1/tests/test_set_dictionary.py +88 -0
  21. pysimultan-0.2.1/tests/test_set_properties.py +159 -0
  22. pysimultan-0.2.1/tests/test_taxonomie_maps.py +33 -0
  23. pysimultan-0.2.1/tests/test_taxonomies.py +15 -0
  24. pysimultan-0.2.1/tests/test_ui.py +517 -0
  25. {pysimultan-0.2 → pysimultan-0.2.1}/LICENSE.txt +0 -0
  26. {pysimultan-0.2 → pysimultan-0.2.1}/README.md +0 -0
  27. {pysimultan-0.2 → pysimultan-0.2.1}/requirements.txt +0 -0
  28. {pysimultan-0.2 → pysimultan-0.2.1}/setup.cfg +0 -0
  29. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan.egg-info/dependency_links.txt +0 -0
  30. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan.egg-info/not-zip-safe +0 -0
  31. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan.egg-info/top_level.txt +0 -0
  32. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/__init__.py +0 -0
  33. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/config.py +0 -0
  34. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/data_model.py +0 -0
  35. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/default_types.py +0 -0
  36. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/files.py +0 -0
  37. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/geometry/__init__.py +0 -0
  38. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/geometry/geometry_base.py +0 -0
  39. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/geometry/utils.py +0 -0
  40. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/multi_values.py +0 -0
  41. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/object_mapper.py +0 -0
  42. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/AssimpNet.dll +0 -0
  43. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/AvalonDock.dll +0 -0
  44. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/BruTile.dll +0 -0
  45. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/ClosedXML.dll +0 -0
  46. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/ComponentBuilder.dll +0 -0
  47. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/ComponentBuilder.dll.config +0 -0
  48. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/ComponentBuilder.runtimeconfig.json +0 -0
  49. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/ComponentBuilder.xml +0 -0
  50. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/ControlzEx.dll +0 -0
  51. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Cyotek.Drawing.BitmapFont.dll +0 -0
  52. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/DocumentFormat.OpenXml.dll +0 -0
  53. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/DotSpatial.Projections.dll +0 -0
  54. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/ExcelNumberFormat.dll +0 -0
  55. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Fluent.dll +0 -0
  56. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/GeometryViewer.dll +0 -0
  57. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/GeometryViewer.dll.config +0 -0
  58. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/GeometryViewer.xml +0 -0
  59. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/HelixToolkit.Core.Wpf.dll +0 -0
  60. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/HelixToolkit.SharpDX.Core.Wpf.dll +0 -0
  61. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/HelixToolkit.SharpDX.Core.dll +0 -0
  62. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/HelixToolkit.dll +0 -0
  63. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/MathNet.Numerics.dll +0 -0
  64. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Microsoft.AspNetCore.Authorization.dll +0 -0
  65. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Microsoft.AspNetCore.Metadata.dll +0 -0
  66. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
  67. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
  68. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Microsoft.Extensions.Options.dll +0 -0
  69. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Microsoft.Extensions.Primitives.dll +0 -0
  70. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Microsoft.WindowsAPICodePack.Shell.dll +0 -0
  71. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Microsoft.WindowsAPICodePack.dll +0 -0
  72. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Microsoft.Xaml.Behaviors.dll +0 -0
  73. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Newtonsoft.Json.Bson.dll +0 -0
  74. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Newtonsoft.Json.dll +0 -0
  75. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SIMULTAN.AutoUpdate.Client.dll +0 -0
  76. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SIMULTAN.AutoUpdate.Client.dll.config +0 -0
  77. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SIMULTAN.AutoUpdate.DataTransferLibrary.dll +0 -0
  78. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SIMULTAN.AutoUpdate.DataTransferLibrary.dll.config +0 -0
  79. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SIMULTAN.Lang.dll +0 -0
  80. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SIMULTAN.Lang.xml +0 -0
  81. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SIMULTAN.Plugins.dll +0 -0
  82. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SIMULTAN.Plugins.xml +0 -0
  83. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SIMULTAN.UI.dll +0 -0
  84. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SIMULTAN.UI.xml +0 -0
  85. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SIMULTAN.dll +0 -0
  86. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SIMULTAN.xml +0 -0
  87. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SharpDX.D3DCompiler.dll +0 -0
  88. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SharpDX.DXGI.dll +0 -0
  89. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SharpDX.Direct2D1.dll +0 -0
  90. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SharpDX.Direct3D11.dll +0 -0
  91. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SharpDX.Direct3D9.dll +0 -0
  92. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SharpDX.Mathematics.dll +0 -0
  93. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SharpDX.dll +0 -0
  94. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SitePlanner.dll +0 -0
  95. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SitePlanner.dll.config +0 -0
  96. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/SitePlanner.xml +0 -0
  97. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Sprache.Calc.dll +0 -0
  98. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/Sprache.dll +0 -0
  99. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/System.Data.OleDb.dll +0 -0
  100. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/System.Net.Http.Formatting.dll +0 -0
  101. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/XAMLMarkupExtensions.dll +0 -0
  102. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/__init__.py +0 -0
  103. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/assimp.dll +0 -0
  104. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/defaultsettings.xml +0 -0
  105. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/resources/setup.bat +0 -0
  106. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/simultan_object.py +0 -0
  107. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/taxonomy_maps.py +0 -0
  108. {pysimultan-0.2 → pysimultan-0.2.1}/src/PySimultan2/utils.py +0 -0
@@ -1,8 +1,9 @@
1
1
  include README.rst
2
2
  include LICENSE.txt
3
3
  include requirements.txt
4
- recursive-exclude tests *
4
+
5
5
  graft src/py_plot_tools/resources
6
6
  graft src/py_plot_tools/basic_geometries/gui_adaptions/infos/generated
7
7
  graft src/py_plot_tools/generated
8
+ recursive-exclude src/tests *
8
9
  recursive-include src/resources *
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySimultan
3
- Version: 0.2
3
+ Version: 0.2.1
4
4
  Home-page:
5
5
  Author: Max Buehler
6
6
  Author-email: Max Bühler <maximilian.buehler@tuwien.ac.at>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "PySimultan"
3
- version = "0.2"
3
+ version = "0.2.1"
4
4
  authors = [
5
5
  {name = "Max Bühler", email = "maximilian.buehler@tuwien.ac.at"}
6
6
  ]
@@ -8,7 +8,7 @@ project_dir = Path(__file__).parent
8
8
 
9
9
  setuptools.setup(
10
10
  name="PySimultan",
11
- version="0.2",
11
+ version="0.2.1",
12
12
  description="Integrate SIMULTAN into Python",
13
13
  # Allow UTF-8 characters in README with encoding argument.
14
14
  long_description=project_dir.joinpath("README.md").read_text(encoding="utf-8"),
@@ -19,7 +19,7 @@ setuptools.setup(
19
19
  package_dir={"": "src"},
20
20
  package_data={
21
21
  # This assumes your package is named "your_package_name"
22
- "PySimultan2": ["resources/*"]
22
+ "PySimultan2": ["resources/*", "tests/*"]
23
23
  },
24
24
  # pip 9.0+ will inspect this field when installing to help users install a
25
25
  # compatible version of the library for their Python version.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySimultan
3
- Version: 0.2
3
+ Version: 0.2.1
4
4
  Home-page:
5
5
  Author: Max Buehler
6
6
  Author-email: Max Bühler <maximilian.buehler@tuwien.ac.at>
@@ -86,4 +86,22 @@ src/PySimultan2/resources/XAMLMarkupExtensions.dll
86
86
  src/PySimultan2/resources/__init__.py
87
87
  src/PySimultan2/resources/assimp.dll
88
88
  src/PySimultan2/resources/defaultsettings.xml
89
- src/PySimultan2/resources/setup.bat
89
+ src/PySimultan2/resources/setup.bat
90
+ tests/test_calc_static_zone_temperature.py
91
+ tests/test_calculate_steady_state_temperature.py
92
+ tests/test_create_geometry.py
93
+ tests/test_files.py
94
+ tests/test_files_load.py
95
+ tests/test_load_geometry.py
96
+ tests/test_load_multi_values.py
97
+ tests/test_new_dll.py
98
+ tests/test_new_project_creation.py
99
+ tests/test_numeric_map.py
100
+ tests/test_pythonnet.py
101
+ tests/test_register_class.py
102
+ tests/test_set_attr_property.py
103
+ tests/test_set_dictionary.py
104
+ tests/test_set_properties.py
105
+ tests/test_taxonomie_maps.py
106
+ tests/test_taxonomies.py
107
+ tests/test_ui.py
@@ -0,0 +1,512 @@
1
+ from PySimultan2 import FileInfo
2
+ from PySimultan2 import DataModel
3
+ from PySimultan2 import PythonMapper
4
+ from PySimultan2.taxonomy_maps import TaxonomyMap, Content
5
+
6
+ from typing import List
7
+
8
+ from tests import resources
9
+ from PySimultan2.geometry.geometry_base import (GeometryModel, SimultanLayer, SimultanVertex, SimultanEdge,
10
+ SimultanEdgeLoop, SimultanFace, SimultanVolume)
11
+ from PySimultan2.geometry.utils import create_cube
12
+
13
+ try:
14
+ import importlib.resources as pkg_resources
15
+ except ImportError:
16
+ import importlib_resources as pkg_resources
17
+
18
+
19
+ with pkg_resources.path(resources, 'new_geometry_test.simultan') as r_path:
20
+ project_path = str(r_path)
21
+
22
+
23
+ data_model = DataModel.create_new_project(project_path=project_path,
24
+ user_name='admin',
25
+ password='admin')
26
+
27
+
28
+ def create_geometry_model(name='new_geometry_test'):
29
+ return GeometryModel(name=name,
30
+ data_model=data_model)
31
+
32
+
33
+ def create_classes() -> dict[str, type]:
34
+
35
+ class Source(object):
36
+ def __init__(self, *args, **kwargs):
37
+ self.name = kwargs.get('name')
38
+ self.temperature = kwargs.get('temperature')
39
+ self.heat_flux = kwargs.get('heat_flux')
40
+
41
+ class TemperatureBoundaryCondition(object):
42
+ def __init__(self, *args, **kwargs):
43
+ self.name = kwargs.get('name')
44
+ self.temperature = kwargs.get('temperature')
45
+
46
+ class HeatFluxBoundaryCondition(object):
47
+ def __init__(self, *args, **kwargs):
48
+ self.name = kwargs.get('name')
49
+ self.heat_flux = kwargs.get('heat_flux')
50
+
51
+ class Material(object):
52
+ def __init__(self, *args, **kwargs):
53
+ self.name = kwargs.get('name')
54
+ self.thermal_conductivity = kwargs.get('thermal_conductivity')
55
+ self.density = kwargs.get('density')
56
+ self.specific_heat = kwargs.get('specific_heat')
57
+
58
+ class WallLayer(object):
59
+ def __init__(self, *args, **kwargs):
60
+ self.name = kwargs.get('name')
61
+ self.thickness = kwargs.get('thickness')
62
+ self.material: Material = kwargs.get('material')
63
+
64
+ @property
65
+ def r_value(self):
66
+ return self.thickness / self.material.thermal_conductivity
67
+
68
+ class Construction(object):
69
+ def __init__(self, *args, **kwargs):
70
+ self.name = kwargs.get('name')
71
+ self.layers: List[WallLayer] = kwargs.get('layers', [])
72
+ self.r_value = kwargs.get('r_value', None)
73
+
74
+ def calculate_r_value(self):
75
+ self.r_value = sum([layer.r_value for layer in self.layers])
76
+ return self.r_value
77
+
78
+ class Wall(object):
79
+
80
+ h_c_lookup = {0.1: 5,
81
+ 0.13: 7.69,
82
+ 0.17: 5.88}
83
+
84
+ def __init__(self, *args, **kwargs):
85
+ self.name = kwargs.get('name')
86
+ self.r_si = kwargs.get('r_si')
87
+ self.r_se = kwargs.get('r_se')
88
+ self.construction: Construction = kwargs.get('construction')
89
+ self.u_value = kwargs.get('u_value', None)
90
+
91
+ self.boundary_condition = kwargs.get('boundary_condition', None)
92
+
93
+ @property
94
+ def area(self):
95
+ return sum((x.area for x in self.associated_geometry))
96
+
97
+ @property
98
+ def h_c(self):
99
+ """
100
+ return the convective heat transfer coefficient h_c in W/m2K
101
+ :return:
102
+ """
103
+ return self.h_c_lookup[self.r_si]
104
+
105
+ def calculate_u_value(self) -> float:
106
+ self.u_value = 1 / (self.r_si + self.r_se + self.construction.calculate_r_value())
107
+ return self.u_value
108
+
109
+ class Zone(object):
110
+ def __init__(self, *args, **kwargs):
111
+ self.name = kwargs.get('name')
112
+ self.walls: List[Wall] = kwargs.get('walls', [])
113
+ self.volume = kwargs.get('volume')
114
+ self.area = kwargs.get('area')
115
+ self.u_value = kwargs.get('u_value', None)
116
+
117
+ self.sources: List[Source] = kwargs.get('sources', [])
118
+ self.steady_state_temperature = kwargs.get('steady_state_temperature', None)
119
+
120
+ def calculate_steady_state_temperature(self):
121
+ phi_ti = []
122
+ for wall in self.walls:
123
+ phi_i = wall.area * wall.calculate_u_value() * wall.r_si * wall.h_c
124
+ phi_ti.append((phi_i * wall.boundary_condition.temperature, phi_i))
125
+
126
+ phi_hc_id = sum(x.heat_flux for x in self.sources)
127
+
128
+ t_steady = (sum(x[0] for x in phi_ti) + phi_hc_id) / sum(x[1] for x in phi_ti)
129
+ self.steady_state_temperature = t_steady
130
+
131
+ return t_steady
132
+
133
+ cls_dict = {'Material': Material,
134
+ 'WallLayer': WallLayer,
135
+ 'Wall': Wall,
136
+ 'Zone': Zone,
137
+ 'TemperatureBoundaryCondition': TemperatureBoundaryCondition,
138
+ 'HeatFluxBoundaryCondition': HeatFluxBoundaryCondition,
139
+ 'Source': Source,
140
+ 'Construction': Construction}
141
+
142
+ return cls_dict
143
+
144
+
145
+ def create_mapped_classes(classes: dict[str, type]) -> dict[str, type]:
146
+
147
+ mapper = PythonMapper()
148
+
149
+ def create_contents() -> dict[str, Content]:
150
+
151
+ contents = {}
152
+
153
+ contents['thermal_conductivity'] = Content(text_or_key='thermal_conductivity',
154
+ property_name='thermal_conductivity',
155
+ type=None,
156
+ unit='W/mK',
157
+ documentation='thermal_conductivity in W/mK')
158
+
159
+ contents['density'] = Content(text_or_key='density',
160
+ property_name='density',
161
+ type=None,
162
+ unit='kg/m3',
163
+ documentation='density in kg/m3')
164
+
165
+ contents['specific_heat'] = Content(text_or_key='specific_heat',
166
+ property_name='specific_heat',
167
+ type=None,
168
+ unit='J/kgK',
169
+ documentation='specific_heat in J/kgK')
170
+
171
+ contents['thickness'] = Content(text_or_key='thickness',
172
+ property_name='thickness',
173
+ type=None,
174
+ unit='m',
175
+ documentation='thickness in m')
176
+
177
+ contents['material'] = Content(text_or_key='material',
178
+ property_name='material',
179
+ type=None,
180
+ unit=None,
181
+ documentation='material')
182
+
183
+ contents['construction'] = Content(text_or_key='construction',
184
+ property_name='construction',
185
+ type=None,
186
+ unit=None,
187
+ documentation='construction')
188
+
189
+ contents['r_si'] = Content(text_or_key='r_si',
190
+ property_name='r_si',
191
+ type=None,
192
+ unit='m2K/W',
193
+ documentation='r_si in m2K/W')
194
+
195
+ contents['r_se'] = Content(text_or_key='r_se',
196
+ property_name='r_se',
197
+ type=None,
198
+ unit=None,
199
+ documentation='r_se in m2K/W')
200
+
201
+ contents['layers'] = Content(text_or_key='layers',
202
+ property_name='layers',
203
+ type=None,
204
+ unit=None,
205
+ documentation='layers of the wall',
206
+ component_policy='subcomponent')
207
+
208
+ contents['u_value'] = Content(text_or_key='u_value',
209
+ property_name='u_value',
210
+ type=None,
211
+ unit='W/m2K',
212
+ documentation='u_value of the wall in W/m2K')
213
+
214
+ contents['r_value'] = Content(text_or_key='r_value',
215
+ property_name='r_value',
216
+ type=None,
217
+ unit='m2K/W',
218
+ documentation='r_value of the wall in W/m2K')
219
+
220
+ contents['boundary_condition'] = Content(text_or_key='boundary_condition',
221
+ property_name='boundary_condition',
222
+ type=None,
223
+ unit=None,
224
+ documentation='boundary_condition')
225
+
226
+ contents['walls'] = Content(text_or_key='walls',
227
+ property_name='walls',
228
+ type=None,
229
+ unit=None,
230
+ documentation='walls of the zone')
231
+
232
+ contents['volume'] = Content(text_or_key='volume',
233
+ property_name='volume',
234
+ type=None,
235
+ unit=None,
236
+ documentation='volume of the zone in m3')
237
+
238
+ contents['area'] = Content(text_or_key='area',
239
+ property_name='area',
240
+ type=None,
241
+ unit='m2',
242
+ documentation='area of the zone in m2')
243
+
244
+ contents['sources'] = Content(text_or_key='sources',
245
+ property_name='sources',
246
+ type=None,
247
+ unit=None,
248
+ documentation='sources of the zone')
249
+
250
+ contents['steady_state_temperature'] = Content(text_or_key='steady_state_temperature',
251
+ property_name='steady_state_temperature',
252
+ type=None,
253
+ unit='K',
254
+ documentation='steady_state_temperature of the zone')
255
+
256
+ contents['temperature'] = Content(text_or_key='temperature',
257
+ property_name='temperature',
258
+ type=None,
259
+ unit='K',
260
+ documentation='temperature in K')
261
+
262
+ contents['heat_flux'] = Content(text_or_key='heat_flux',
263
+ property_name='heat_flux',
264
+ type=None,
265
+ unit='W',
266
+ documentation='heat_flux in W')
267
+
268
+ return contents
269
+
270
+ def create_mapped_material(cls, contents: dict[str, Content]):
271
+
272
+ cls_map = TaxonomyMap(taxonomy_name='PySimultan',
273
+ taxonomy_key='PySimultan',
274
+ taxonomy_entry_name='Material',
275
+ taxonomy_entry_key='Material',
276
+ content=[contents['thermal_conductivity'],
277
+ contents['density'],
278
+ contents['specific_heat']],
279
+ )
280
+
281
+ mapper.register(cls_map.taxonomy_entry_key, cls, taxonomy_map=cls_map)
282
+ mapped_cls = mapper.get_mapped_class(cls_map.taxonomy_entry_key)
283
+ return mapped_cls
284
+
285
+ def create_layer_cls(cls, contents: dict[str, Content]):
286
+
287
+ cls_map = TaxonomyMap(taxonomy_name='PySimultan',
288
+ taxonomy_key='PySimultan',
289
+ taxonomy_entry_name='Layer',
290
+ taxonomy_entry_key='Layer',
291
+ content=[contents['thickness'], contents['material']],
292
+ )
293
+
294
+ mapper.register(cls_map.taxonomy_entry_key, cls, taxonomy_map=cls_map)
295
+ mapped_cls = mapper.get_mapped_class(cls_map.taxonomy_entry_key)
296
+ return mapped_cls
297
+
298
+ def create_construction_cls(cls, contents: dict[str, Content]):
299
+
300
+ cls_map = TaxonomyMap(taxonomy_name='PySimultan',
301
+ taxonomy_key='PySimultan',
302
+ taxonomy_entry_name='Construction',
303
+ taxonomy_entry_key='Construction',
304
+ content=[contents['layers'], contents['r_value']],
305
+ )
306
+
307
+ mapper.register(cls_map.taxonomy_entry_key, cls, taxonomy_map=cls_map)
308
+ mapped_cls = mapper.get_mapped_class(cls_map.taxonomy_entry_key)
309
+ return mapped_cls
310
+
311
+ def create_wall_cls(cls, contents: dict[str, Content]):
312
+
313
+ cls_map = TaxonomyMap(taxonomy_name='PySimultan',
314
+ taxonomy_key='PySimultan',
315
+ taxonomy_entry_name='Wall',
316
+ taxonomy_entry_key='Wall',
317
+ content=[contents['r_si'],
318
+ contents['r_se'],
319
+ contents['construction'],
320
+ contents['u_value'],
321
+ contents['boundary_condition']],
322
+ )
323
+
324
+ mapper.register(cls_map.taxonomy_entry_key, cls, taxonomy_map=cls_map)
325
+ mapped_cls = mapper.get_mapped_class(cls_map.taxonomy_entry_key)
326
+ return mapped_cls
327
+
328
+ def create_zone_cls(cls, contents: dict[str, Content]):
329
+
330
+ cls_map = TaxonomyMap(taxonomy_name='PySimultan',
331
+ taxonomy_key='PySimultan',
332
+ taxonomy_entry_name='Zone',
333
+ taxonomy_entry_key='Zone',
334
+ content=[contents['walls'],
335
+ contents['volume'],
336
+ contents['area'],
337
+ contents['u_value'],
338
+ contents['sources'],
339
+ contents['steady_state_temperature']],
340
+ )
341
+
342
+ mapper.register(cls_map.taxonomy_entry_key, cls, taxonomy_map=cls_map)
343
+ mapped_cls = mapper.get_mapped_class(cls_map.taxonomy_entry_key)
344
+ return mapped_cls
345
+
346
+ def create_temperature_bc_cls(cls, contents: dict[str, Content]):
347
+ cls_map = TaxonomyMap(taxonomy_name='PySimultan',
348
+ taxonomy_key='PySimultan',
349
+ taxonomy_entry_name='TemperatureBoundaryCondition',
350
+ taxonomy_entry_key='TemperatureBoundaryCondition',
351
+ content=[contents['temperature']],
352
+ )
353
+
354
+ mapper.register(cls_map.taxonomy_entry_key, cls, taxonomy_map=cls_map)
355
+ mapped_cls = mapper.get_mapped_class(cls_map.taxonomy_entry_key)
356
+ return mapped_cls
357
+
358
+ def create_heat_flux_bc_cls(cls, contents: dict[str, Content]):
359
+ cls_map = TaxonomyMap(taxonomy_name='PySimultan',
360
+ taxonomy_key='PySimultan',
361
+ taxonomy_entry_name='HeatFluxBoundaryCondition',
362
+ taxonomy_entry_key='HeatFluxBoundaryCondition',
363
+ content=[contents['heat_flux']],
364
+ )
365
+
366
+ mapper.register(cls_map.taxonomy_entry_key, cls, taxonomy_map=cls_map)
367
+ mapped_cls = mapper.get_mapped_class(cls_map.taxonomy_entry_key)
368
+ return mapped_cls
369
+
370
+ def create_source_cls(cls, contents: dict[str, Content]):
371
+ cls_map = TaxonomyMap(taxonomy_name='PySimultan',
372
+ taxonomy_key='PySimultan',
373
+ taxonomy_entry_name='Source',
374
+ taxonomy_entry_key='Source',
375
+ content=[contents['temperature'],
376
+ contents['heat_flux']],
377
+ )
378
+
379
+ mapper.register(cls_map.taxonomy_entry_key, cls, taxonomy_map=cls_map)
380
+ mapped_cls = mapper.get_mapped_class(cls_map.taxonomy_entry_key)
381
+ return mapped_cls
382
+
383
+ tax_contents = create_contents()
384
+
385
+ mapped_material_cls = create_mapped_material(classes['Material'], tax_contents)
386
+ mapped_layer_cls = create_layer_cls(classes['WallLayer'], tax_contents)
387
+ mapped_construction_cls = create_construction_cls(classes['Construction'], tax_contents)
388
+ mapped_wall_cls = create_wall_cls(classes['Wall'], tax_contents)
389
+ mapped_zone_cls = create_zone_cls(classes['Zone'], tax_contents)
390
+ mapped_temperature_bc_cls = create_temperature_bc_cls(classes['TemperatureBoundaryCondition'], tax_contents)
391
+ mapped_heat_flux_bc_cls = create_heat_flux_bc_cls(classes['HeatFluxBoundaryCondition'], tax_contents)
392
+ mapped_source_cls = create_source_cls(classes['Source'], tax_contents)
393
+
394
+ mapped_cls_dict = {'Material': mapped_material_cls,
395
+ 'Layer': mapped_layer_cls,
396
+ 'Construction': mapped_construction_cls,
397
+ 'Wall': mapped_wall_cls,
398
+ 'Zone': mapped_zone_cls,
399
+ 'TemperatureBoundaryCondition': mapped_temperature_bc_cls,
400
+ 'HeatFluxBoundaryCondition': mapped_heat_flux_bc_cls,
401
+ 'Source': mapped_source_cls}
402
+
403
+ return mapped_cls_dict
404
+
405
+
406
+ if __name__ == '__main__':
407
+ geo_model = create_geometry_model(name='new_geometry_test')
408
+
409
+ cube = create_cube(data_model, geo_model, scale=10)
410
+
411
+ classes = create_classes()
412
+ mapped_classes = create_mapped_classes(classes)
413
+
414
+ Material = mapped_classes['Material']
415
+ WallLayer = mapped_classes['Layer']
416
+ Construction = mapped_classes['Construction']
417
+ Wall = mapped_classes['Wall']
418
+ Zone = mapped_classes['Zone']
419
+ TemperatureBoundaryCondition = mapped_classes['TemperatureBoundaryCondition']
420
+ HeatFluxBoundaryCondition = mapped_classes['HeatFluxBoundaryCondition']
421
+ Source = mapped_classes['Source']
422
+
423
+ t_out_1 = TemperatureBoundaryCondition(name='t_out_1',
424
+ temperature=273.15)
425
+
426
+ t_out_2 = TemperatureBoundaryCondition(name='t_out_2',
427
+ temperature=283.15)
428
+
429
+ concrete = Material(name='concrete',
430
+ thermal_conductivity=1.5,
431
+ density=2000,
432
+ specific_heat=800)
433
+
434
+ insulation = Material(name='insulation',
435
+ thermal_conductivity=0.03,
436
+ density=150,
437
+ specific_heat=1500)
438
+
439
+ plaster = Material(name='plaster',
440
+ thermal_conductivity=0.6,
441
+ density=1200,
442
+ specific_heat=700)
443
+
444
+ construction_1 = Construction(name='construction_1',
445
+ layers=[WallLayer(name='concrete_layer', thickness=0.2, material=concrete),
446
+ WallLayer(name='insulation_layer', thickness=0.1, material=insulation),
447
+ WallLayer(name='plaster_layer', thickness=0.01, material=plaster)])
448
+
449
+ construction_2 = Construction(name='construction_2',
450
+ layers=[WallLayer(name='concrete_layer', thickness=0.15, material=concrete),
451
+ WallLayer(name='insulation_layer', thickness=0.2, material=insulation)
452
+ ]
453
+ )
454
+
455
+ wall1 = Wall(name='Wall1',
456
+ r_si=0.13,
457
+ r_se=0.04,
458
+ construction=construction_1,
459
+ boundary_condition=t_out_1)
460
+ wall1.associate(cube.faces[0])
461
+
462
+ wall2 = Wall(name='Wall2',
463
+ r_si=0.13,
464
+ r_se=0.04,
465
+ construction=construction_2,
466
+ boundary_condition=t_out_2)
467
+ wall2.associate(cube.faces[1])
468
+
469
+ wall3 = Wall(name='Wall3',
470
+ r_si=0.13,
471
+ r_se=0.04,
472
+ construction=construction_1,
473
+ boundary_condition=t_out_1)
474
+ wall3.associate(cube.faces[2])
475
+
476
+ wall4 = Wall(name='Wall4',
477
+ r_si=0.13,
478
+ r_se=0.04,
479
+ construction=construction_2,
480
+ boundary_condition=t_out_2)
481
+ wall4.associate(cube.faces[3])
482
+
483
+ wall5 = Wall(name='Wall5',
484
+ r_si=0.13,
485
+ r_se=0.04,
486
+ construction=construction_2,
487
+ boundary_condition=t_out_1)
488
+ wall5.associate(cube.faces[4])
489
+
490
+ wall6 = Wall(name='Wall6',
491
+ r_si=0.13,
492
+ r_se=0.04,
493
+ construction=construction_2,
494
+ boundary_condition=t_out_2)
495
+ wall6.associate(cube.faces[5])
496
+
497
+ convective_heat_source = Source(name='convective_heat_source',
498
+ heat_flux=1000)
499
+
500
+ zone1 = Zone(name='zone_1',
501
+ walls=[wall1, wall2, wall3, wall4, wall5, wall6],
502
+ sources=[convective_heat_source])
503
+ zone1.associate(cube)
504
+
505
+ print(cube.components)
506
+ print(list(zone1.associated_geometry))
507
+
508
+ steady_state_temperature = zone1.calculate_steady_state_temperature()
509
+ print(steady_state_temperature)
510
+
511
+ data_model.save()
512
+ data_model.cleanup()