Jump to content
Ventilation & Flow Simulation Forums

Scripting?


Fred_K

Recommended Posts

Hello!

 

How do I go about running simulation scenarios automatically in VentSim, without having to manually change simulation parameters and then running each scenario individually? Is there a guide available for using the scripting function? I'm getting an "EOF in header" error when trying to read a script file I've created, and I can't open the file itself either ("... file format or extension is not valid..."). What am I doing wrong?

 

Cheers!

Frédéric

Link to comment
Share on other sites

Hi Frédéric,

It depends  on which parameters you are wanting to change, but the scripting tool may be your best bet.

A quick guide to the tool:

Use the Connect menu and launch the static script tool.

Then select the Create button first, this will generate a script that contains each airway in your model.

image.png.c1483b2ae269b035842ca6bf39a87eb8.png

Open the file that was generated and you should see that the output will contain all of the airways, but you can delete the ones you aren't intending to modify across the scripts.

The file format is pretty much just the Ventsim Excel file format for the airways.

In this case for simplicity sake, I have removed everything but these first two airways (just so you get the idea):

image.thumb.png.60c8f1783a70f3bec672a4ba34aeb26a.png

Now that I am left with just a couple of rows, it will be much easier for me to make a few scripts that will execute one after the other.

To do this you just copy and paste the rows and then change the number in the first column, and then you can modify some other part of that airway's properties in the other columns.

image.thumb.png.0172a2d9be17204c1148125f3b6ad07d.png

Make sure you keep each script's rows together. It's okay to have a space between scripts but it isn't necessary.

The rest of the model will remain identical to how it is at the time that you run the script.

Now back in the Static Script form, you can select that file you created as the Script File and also you will need to choose a location to save the results as an output file, using the buttons is the easiest way.

Then choose which types of simulations you want to run on your script using the Simulate options.

Then for the output format, you can choose to output all of the data columns possible, or you can select the data values you are interested in only using the Selected button on the Output area of this form.  Running the Test will show you how your output will look.

image.png.c1483b2ae269b035842ca6bf39a87eb8.png

The extra options are to Reset after each run: this just resets the results between scripts.

Output only input airways: this one limits the data output to just the airways found in the script, otherwise it will output every airway's results).

Summarise only input airways: each script output contains a summary report, if this is selected the summary details will only be for the airways found in the script, otherwise the whole model will be summarised.

Create New Worksheet each case: this will set the results into different worksheets, but they will be within the same result file. You can also use the Output folder and Prefix to name the script outputs as separate files that will appear in a selected output folder.

Auto-exclude: to remove airways mined after a input date from the scripting

The final choice is just there to give you an easy way to change between outputting all of the possible results columns (Native Output) or just the ones you selected (Selected Output).

Then you can just run the scripts with the Run button and you should see a results file something like this:

image.thumb.png.a109542e52c77b9d20ab61295043e557.png

If you need help with modifying a specific property of an airway in the script file, let us know as it can be a bit tricky to know exactly what to change there.

If you need help with the script file you have already made, send it to us at ventsim.support@howden.com and we will take a look at it and see what it is missing.

Regards,

Craig

 

 

Link to comment
Share on other sites

Hi Craig,

 

thank you for your clear and detailed guide, it is much appreciated!

What I would like to do, and I apologize, I should've been a little clearer, is to set up a range of heat simulation scenarios, by changing some of the parameters in the Settings -> Settings -> Simulation window.

 

I've attempted to follow your guide.

My problem starts fairly early:

9 hours ago, Craig Christensen said:

Open the file that was generated and you should see that the output will contain all of the airways, but you can delete the ones you aren't intending to modify across the scripts.

 

I can't open it. Instead, I get the following messages (second message after clicking Yes) 

XLSX msg1

XLSX msg2

 

The file itself also seems a little off, as it's only 26 bytes, and that just seems way too small.

XLSX prop

 

Finally, when I want to open the generated file from VentSim by clicking the Show button in the window, I get the following message:

ventsim EOF

 

I don't know what this means exactly, whether it is something that I have done wrong or if this is a bug. I have checked the static script function with a model made up of one airway, but the problem is the same.

 

Best regards,

Frédéric

 

Edited by Fred_K
Correction: File size is bytes, not kilobytes
Link to comment
Share on other sites

Hi Frédéric, 

Can you let us know what version you are running? We will see if we can recreate it.

You can't change any of the system settings in the script though, so this might not be the tool to use. 

What are you looking to achieve with the different heat sims? We may be able to point you to a more suitable tool for what you are trying to do.

Regards,

Craig

Link to comment
Share on other sites

Hi Craig, 

 

I'm running Design Premium 5.4.4.8, 64bit.

 

What I would like to achieve is simulating different scenarios as well as sensitivity analyses where I would vary only one parameter at a time, and see the effect on the heat load. I want to be able to do this partly for my curiosity, but also because some parameters vary depending on where and how they were measured. That means the rock thermal parameters, the geothermal gradient and the outside air temperatures (= an extreme summer/winter) mostly.

 

I guess with the few parameters I'm interested in it's relatively simple to do a sensitivity analysis. And I could set up a list of combinations that I could go back to, and manually change my parameters. But it would be nice to not have to do that and just feed such a list into VentSim or tell VentSim to run scenarios and change X in steps of Y.

 

Since I can't open the script file, I don't really know what parameters I can change, but it looks like from your screenshot it looks like it's the properties of the airways?

On 8/5/2021 at 1:37 AM, Craig Christensen said:

image.thumb.png.0172a2d9be17204c1148125f3b6ad07d.png

 

Best regards,

Frédéric

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...