--
To unsubscribe from this group, send email to contam+un...@list.nist.gov
View this message at https://list.nist.gov/contam
---
To unsubscribe from this group and stop receiving emails from it, send an email to contam+un...@list.nist.gov.
Xingji,
contamxpy has nothing inherently to do with FMI or EnergyPlus. It provides a wrapper around the CONTAM simulation engine, ContamX, that can be imported into python modules. It provides the ability to control simulation execution, obtain
simulation results, and exchange data with ContamX using a very similar API as provided by ContamX’s socket communication API. Note that contamxpy is a wrapper around a statically linked, contamx-lib. However, contamx-lib is also available as a DLL which provides
a C interface/API.
The ContamFMU.dll requires another program to provide the controlling, i.e., master, algorithm, e.g., EnergyPlus, as per the FMI for Co-Simulation specification version 1.0. It was written specifically to work with EnergyPlus, although there is nothing inherent
to prevent one from utilizing it with another controlling program. While it is convenient, one need not use the Contam3DExporter to generate an FMU (which is simply a zip archive which also conforms to FMI specifications). The FMU generated by 3DExporter does
contain the PRJ which is used to generate the associated EnergyPlus IDF file. ContamFMU.dll acts as a means to exchange variables between EnergyPlus and ContamX at each simulation time step during co-simulation.
I have not attempted to utilize ContamFMU in conjunction with other FMUs either with or without EnergyPlus providing the controlling algorithm.
You say you want to use EnergyPlus, but you do not want to use it to provide the controlling algorithm.
From your messages, the reasons for this are not apparent to me (that’s not to say that there couldn’t be any good ones
😊).
- Stuart
Just as the building check pointed out, there is an undefined Simple AHS in the PRJ.
If you click on the message in the building check dialog, it will take you to the offending item.
- Stuart
From: Xingji Yu <yuxing...@gmail.com>
Sent: Friday, December 1, 2023 12:19 PM
To: CONTAM <con...@list.nist.gov>
Cc: Dols, William Stuart (Fed) <willia...@nist.gov>; Stuart Dols <stu...@gmail.com>; CONTAM <con...@list.nist.gov>; Xingji Yu <yuxing...@gmail.com>
Subject: Re: [contam] Question regarding co-simulation
Hi Stuart,
I have one more question. I am now setting up the Contam model AHU unit. I tried to run the simulation, but it reports an error saying: undefined smple AHS. I think I followed the tutorial online, but the error did not happen in the tutorial. Could you tell what could be the reason for this error? I put my .prj file in this message.
Best,
Xingji
On Tuesday, October 31, 2023 at 8:50:40 PM UTC+1 Dols, William Stuart (Fed) wrote:
Please review the python driver programs and API documentation to help understand how to use the python bindings for the API.
The controls that you are showing have nothing to do with the API.
Only Constant (Set) and Split (pass) controls with Names assigned to them are accessible via the API.
The following shows the output when running test_cxcffi.py with the --verbose=1 option.
This shows the controls that are available to the API along with other building components found in the PRJ.
None of the example drivers demonstrate the use of the controls.
For this, you should refer to the following API functions:
I’m not sure about the “technical feasibility” of your simulation plan.
I will say to start out simple before trying to develop a complex building model.
- Stuart
From: con...@list.nist.gov
con...@list.nist.gov On Behalf Of
Xingji Yu
Sent: Wednesday, December 6, 2023 2:48 PM
To: CONTAM <con...@list.nist.gov>
Cc: Dols, William Stuart (Fed) <willia...@nist.gov>; Stuart Dols <stu...@gmail.com>; CONTAM <con...@list.nist.gov>; Xingji Yu <yuxing...@gmail.com>
Subject: Re: [contam] Question regarding co-simulation
Hi Stuart,
Sorry for bothering you again. I am checking the demo_files folder of contampy and tried to run them, and it works. Basically, python can control the simulation execution, obtain simulation results, and exchange data with ContamX from the examples. I think it is realized by the control blocks (in green) in contam, but I cannot find the blocks in the software, is there any tutorials that systematically introduce the routine to set those blocks?
Xingji,
You can add an AHS to the test_OneZoneWthCtm-UseApi.prj.
The associated script, test_OneZoneWthCtm.py, will then set the number of AHSs to 1 and set the flows and OA fraction as per the arrays of associated data (set via setWthCtmInit() and setWthCtmData() functions).
The attached PRJ does just this with a filter incorporated into the OA of the AHS to show the affects of the AHS on the indoor contaminant results.
There are no “hidden” AHSs in the test_OneZoneWthCtm-UseApi.prj, it is just that there are none detected within the PRJ, so the associated AHS functions are not called.
The properties of the PRJ (including number of AHSs) are determined upon instantiation of the cxLib object as shown in the highlighted line of code:
You can read about the cxLib class and associated construtor in the documentation, contamxpy.pdf.
- Stuart
From: Xingji Yu <yuxing...@gmail.com>
Sent: Friday, February 21, 2025 7:28 AM
To: CONTAM <con...@list.nist.gov>
Cc: Dols, William Stuart (Fed) <willia...@nist.gov>; yuxing...@gmail.com <yuxing...@gmail.com>; stu...@gmail.com <stu...@gmail.com>; CONTAM <con...@list.nist.gov>
Subject: Re: [contam] Question regarding co-simulation
Hi Stuart,
I hope you’re doing well. I’ve been working with Contam and the contamxpy Python interface, and I’m trying to dynamically modify mechanical ventilation flow rates in my simulation. However, I’m a bit confused about how Simple Air Handling Systems (AHS) are represented—particularly in cases where there is no visible AHS icon in the demo .prj file’s geometry (like test_OneZoneWthCtm.prj).
None of the example drivers demonstrate the use of the controls.
For this, you should refer to the following API functions:
I’m not sure about the “technical feasibility” of your simulation plan.
I will say to start out simple before trying to develop a complex building model.
- Stuart
From: con...@list.nist.gov con...@list.nist.gov On Behalf Of Xingji Yu
Sent: Wednesday, December 6, 2023 2:48 PM
To: CONTAM <con...@list.nist.gov>
Cc: Dols, William Stuart (Fed) <willia...@nist.gov>; Stuart Dols <stu...@gmail.com>; CONTAM <con...@list.nist.gov>; Xingji Yu <yuxing...@gmail.com>
Subject: Re: [contam] Question regarding co-simulation
Hi Stuart,
Sorry for bothering you again. I am checking the demo_files folder of contampy and tried to run them, and it works. Basically, python can control the simulation execution, obtain simulation results, and exchange data with ContamX from the examples. I think it is realized by the control blocks (in green) in contam, but I cannot find the blocks in the software, is there any tutorials that systematically introduce the routine to set those blocks?
My observation is that although I change the mechanical ventilation value (fan_airflow) dynamically (varying between day and night), the infiltration flow (InfFlow) remains unchanged when I fix the ambient temperature (amb_temp = 15.0). In contrast, when I vary the temperature, infiltration changes accordingly.
Could you please advise:
I am attaching the Python code along with the .prj file for your review. I appreciate any guidance you can provide regarding this issue.
Best regards,
Xingji
When I run your module, the resultant SIM file is invalid, i.e., I can’t view results via ContamW.
You should be able to verify whether your results are as desired by viewing the results with ContamW.
I don’t really have time to debug this.
I don’t see any reason why modifications to temperature should affect infiltration for this case as all flow paths are located at the same elevation. This means that there will be no buoyancy-driven airflow.
- Stuart
From: Xingji Yu <yuxing...@gmail.com>
Sent: Monday, February 24, 2025 11:31 PM
To: CONTAM <con...@list.nist.gov>
Cc: Dols, William Stuart (Fed) <willia...@nist.gov>; stu...@gmail.com <stu...@gmail.com>; CONTAM <con...@list.nist.gov>; Xingji Yu <yuxing...@gmail.com>
Subject: Re: [contam] Question regarding co-simulation
Hi Stuart,
Thanks for your reply. I am currently testing a simplified Python script using contamxpy to verify if I can dynamically modify boundary conditions in Contam. In my test, I vary the mechanical ventilation flow rate (fan airflow) by adjusting it during different time steps (day vs. night). Although I see changes in infiltration when ambient temperature is varied, the infiltration flow (InfFlow) remains constant when I change the mechanical ventilation value.
My observation is that although I change the mechanical ventilation value (fan_airflow) dynamically (varying between day and night), the infiltration flow (InfFlow) remains unchanged when I fix the ambient temperature (amb_temp = 15.0). In contrast, when I vary the temperature, infiltration changes accordingly.
Could you please advise:
I am attaching the Python code along with the .prj file for your review. I appreciate any guidance you can provide regarding this issue.
Best regards,
Xingji
On Friday, February 21, 2025 at 4:40:28 PM UTC+1 Dols, William Stuart (Fed) wrote:
Xingji,
You can add an AHS to the test_OneZoneWthCtm-UseApi.prj.
The associated script, test_OneZoneWthCtm.py, will then set the number of AHSs to 1 and set the flows and OA fraction as per the arrays of associated data (set via setWthCtmInit() and setWthCtmData() functions).
The attached PRJ does just this with a filter incorporated into the OA of the AHS to show the affects of the AHS on the indoor contaminant results.
There are no “hidden” AHSs in the test_OneZoneWthCtm-UseApi.prj, it is just that there are none detected within the PRJ, so the associated AHS functions are not called.
The properties of the PRJ (including number of AHSs) are determined upon instantiation of the cxLib object as shown in the highlighted line of code:
You can read about the cxLib class and associated construtor in the documentation, contamxpy.pdf.
- Stuart
None of the example drivers demonstrate the use of the controls.
For this, you should refer to the following API functions:
I’m not sure about the “technical feasibility” of your simulation plan.
I will say to start out simple before trying to develop a complex building model.
- Stuart
From: con...@list.nist.gov con...@list.nist.gov On Behalf Of Xingji Yu
Sent: Wednesday, December 6, 2023 2:48 PM
To: CONTAM <con...@list.nist.gov>
Cc: Dols, William Stuart (Fed) <willia...@nist.gov>; Stuart Dols <stu...@gmail.com>; CONTAM <con...@list.nist.gov>; Xingji Yu <yuxing...@gmail.com>
Subject: Re: [contam] Question regarding co-simulation
Hi Stuart,
Sorry for bothering you again. I am checking the demo_files folder of contampy and tried to run them, and it works. Basically, python can control the simulation execution, obtain simulation results, and exchange data with ContamX from the examples. I think it is realized by the control blocks (in green) in contam, but I cannot find the blocks in the software, is there any tutorials that systematically introduce the routine to set those blocks?
I’m seeing unexpected zero infiltration when I feed in dynamic wind conditions. A quick summary of my setup and questions:
Zero infiltration with dynamic wind
– I’ve configured only three external wall leak paths (IDs 1–3). If I assign each a constant 100 Pa wind pressure in the GUI, I see non-zero airflow. But when I switch them to “Variable” wind pressure and drive Contam with a time series of wind speed & direction via Python
the summed infiltration remains exactly zero. Shouldn’t the variable-pressure option internally compute Δp from v and apply it to each path?
Exposing or overriding per-path Δp
– There’s no setAmbtWindPressure() in cxLib, so I can’t push per-path pressure differences from Python. Does Contam automatically calculate Δp = ½·ρ·v²·Cp(azimuth)? If so, is there a way to inspect those Cp or Δp values at runtime? Or must I pre-compute and feed in a constant wind pressure schedule?
Best practice for a sealed glazing wall
– My south façade is a sealed triple-glazing unit (no supply-air mode). I’m using Leakage Area Data (per item) with reference Δp=10 Pa, C=0.6, n=0.65. Would “Orifice Area Data” or another model better represent a solid glazed wall’s leakage characteristics?
Any pointers on how to get non-zero, time-varying infiltration — or how to debug Contam’s internal Δp application — would be greatly appreciated.
Thanks for your help
Xingji