-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add function to convert material data;
PWPA-1960
- Loading branch information
Gabriel Antão
committed
Jun 17, 2024
1 parent
e2e7593
commit 6ec0ba6
Showing
4 changed files
with
205 additions
and
3 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/alfasim_score/converter/alfacase/_tests/test_convert_materials.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from pytest_regressions.data_regression import DataRegressionFixture | ||
|
||
from alfasim_score.converter.alfacase.convert_alfacase import ScoreAlfacaseConverter | ||
from alfasim_score.converter.alfacase.score_input_reader import ScoreInputReader | ||
from alfasim_score.converter.fixtures import score_input_example | ||
|
||
|
||
def test_convert_materials( | ||
data_regression: DataRegressionFixture, | ||
score_input_example: ScoreInputReader, | ||
) -> None: | ||
builder = ScoreAlfacaseConverter(score_input_example) | ||
materials = builder.convert_materials() | ||
data_regression.check( | ||
[ | ||
{ | ||
"name": material.name, | ||
"type": material.material_type.value, | ||
"density": material.density.GetValue(), | ||
"thermal_conductivity": material.thermal_conductivity.GetValue(), | ||
"heat_capacity": material.heat_capacity.GetValue(), | ||
"thermal_expansion": material.expansion.GetValue(), | ||
} | ||
for material in materials | ||
] | ||
) |
108 changes: 108 additions & 0 deletions
108
...alfasim_score/converter/alfacase/_tests/test_convert_materials/test_convert_materials.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
- density: 15.7743 | ||
heat_capacity: 837.9 | ||
name: cement | ||
thermal_conductivity: 0.983057 | ||
thermal_expansion: 1.0e-06 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 65.5035 | ||
heat_capacity: 460.9 | ||
name: SDSS/125KSI | ||
thermal_conductivity: 45.345257 | ||
thermal_expansion: 1.2e-05 | ||
type: solid | ||
- density: 1.0 | ||
heat_capacity: 5.0 | ||
name: Folhelho | ||
thermal_conductivity: 50.0 | ||
thermal_expansion: 0.0 | ||
type: solid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters