-
Notifications
You must be signed in to change notification settings - Fork 24
844 add solar radiation to pluginopenfoam #874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hochbean
merged 19 commits into
development
from
844-add-solar-radiation-to-pluginopenfoam
Apr 14, 2026
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
271951c
Migrate previous work from private repo
hochbean 47421ef
Minor corrections to modifications
hochbean dd11229
Fix typo in scripts
hochbean 1a400c9
Remove solar load on windows for all cases
hochbean d3dfd29
Merge branch 'development' into 844-add-solar-radiation-to-pluginopen…
hochbean fb01385
Fix heat balances for solar load cases
hochbean 3f34342
Add hints for solar radiation to docu
hochbean 557b9fd
Merge branch 'development' into 844-add-solar-radiation-to-pluginopen…
hochbean 663c9f2
Add example for solar radiation
hochbean caa2d9f
Minor improvements
hochbean 945d5e1
Update submodule of test resources
hochbean cf203e9
Minor corrections and comments
hochbean 0137d66
Reactiate teardown
hochbean 39fb265
Add new simsettings to docu
hochbean 61f081a
Update submodule of test resources
hochbean ec10eba
Correct diff report function
hochbean 2282026
Update test resources
hochbean 506c9e2
Merge branch 'development' into 844-add-solar-radiation-to-pluginopen…
hochbean 82d4caf
Merge branch 'development' into 844-add-solar-radiation-to-pluginopen…
veronikarichter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
79 changes: 79 additions & 0 deletions
79
bim2sim/plugins/PluginOpenFOAM/bim2sim_openfoam/examples/e19_openfoam_solar_radiation.py
This file contains hidden or 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,79 @@ | ||
| import tempfile | ||
| from pathlib import Path | ||
|
|
||
| import bim2sim | ||
| from bim2sim import Project, run_project, ConsoleDecisionHandler | ||
| from bim2sim.plugins.PluginOpenFOAM.bim2sim_openfoam import OpenFOAMSimSettings | ||
| from bim2sim.project import add_config_section | ||
| from bim2sim.kernel.decision.decisionhandler import DebugDecisionHandler | ||
| from bim2sim.utilities.types import IFCDomain | ||
|
|
||
| def run_example_19(): | ||
| """ | ||
| Prepare an OpenFOAM case with a radiator and solar radiation. | ||
|
|
||
| This example runs a BPS with the EnergyPlus backend and a CFD simulation | ||
| with the OpenFOAM backend. It specifies project | ||
| directory and location of the IFC file. Then, it creates a bim2sim | ||
| project with the EnergyPlus backend. Simulation settings are specified | ||
| (EnergyPlus location needs to be specified according to your system, | ||
| other settings are set to default if not specified otherwise), | ||
| before the project is executed with the previously specified settings. | ||
|
|
||
| The EnergyPlus simulation is followed by the setup of the OpenFOAM | ||
| CFD use case, which bases on the same IFC input as the previously set | ||
| up EnergyPlus use case. | ||
| """ | ||
| # Create a temp directory for the project, feel free to use a "normal" | ||
| # directory | ||
| project_path = Path( | ||
| tempfile.TemporaryDirectory(prefix='bim2sim_openfoam19_').name) | ||
|
|
||
| # download additional test resources for arch domain, you might want to set | ||
| # force_new to True to update your test resources | ||
| # Set the ifc path to use and define which domain the IFC belongs to | ||
| ifc_paths = { | ||
| IFCDomain.arch: | ||
| Path(bim2sim.__file__).parent.parent / | ||
| 'test/resources/arch/ifc/AC20-FZK-Haus.ifc', | ||
| } | ||
| project = Project.create(project_path, ifc_paths, 'openfoam') | ||
| project.sim_settings.weather_file_path = ( | ||
| Path(bim2sim.__file__).parent.parent / | ||
| 'test/resources/weather_files/DEU_NW_Aachen.105010_TMYx.epw') | ||
|
|
||
| # Set the install path to your EnergyPlus installation according to your | ||
| # system requirements | ||
| # project.sim_settings.ep_install_path = 'C://EnergyPlusV9-4-0/' | ||
|
|
||
| # Set other simulation settings, otherwise all settings are set to default | ||
| project.sim_settings.run_full_simulation = True | ||
| project.sim_settings.cfd_export = True | ||
| # project.sim_settings.select_space_guid = '3GmoJyFk9FvAnea6mogixJ' | ||
| project.sim_settings.select_space_guid = '2RSCzLOBz4FAK$_wE8VckM' | ||
| project.sim_settings.simulation_time = 12 | ||
| project.sim_settings.simulation_date = '01/14' | ||
| project.sim_settings.building_rotation_overwrite = 180 | ||
| project.sim_settings.add_heating = True | ||
| project.sim_settings.fixed_faces = [] | ||
|
|
||
| project.sim_settings.total_iterations = 6000 | ||
| project.sim_settings.n_procs = 48 | ||
| project.sim_settings.radiation_model = 'fvDOM' | ||
| project.sim_settings.cluster_max_runtime_simulation = "03:59:00" | ||
|
|
||
| project.sim_settings.add_solar_radiation = False | ||
| project.sim_settings.set_openfoam_source = 'Modified' | ||
| project.sim_settings.cluster_jobname = "solar_radiation" | ||
|
|
||
| answers = ('Autodesk Revit','Autodesk Revit', *(None,)*13, | ||
| *('HVAC-AirTerminal',)*3, | ||
| *(None,)*2, 2015) | ||
| # Run the project with the ConsoleDecisionHandler. This allows interactive | ||
| # input to answer upcoming questions regarding the imported IFC. | ||
| run_project(project, DebugDecisionHandler(answers)) | ||
| # run_project(project, ConsoleDecisionHandler()) | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| run_example_19() |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.