GralDispersionModel/GUI

Source Sensitivity Analysis

Closed this issue · 6 comments

eta10 commented

Hello.
I am using GRAMM GRAL since almost a year now where I made two projects using only the GUI.
Now, I am trying to test source location sensitivity within my domain without using the GUI. I have already obtained the .wnd and .gff files for my conditions; the issue now is that I am trying to automate placing one source at a new location and then obtaining the new concentration files. This would be a part of a larger code, so I will be calling one or more of the codes/modules/functions.
Do you think this is possible? If yes, what codes would help in this issue?

Dear eta10,
if you don't want to use the GUI, it would be sufficient to modify the source file in the calculation folder (e.g. point.dat) and output the result files as ESRI-ASCii files (line 17 in the file in.dat).
Afterwards one can change the source file in a simple application, evaluate the ASCii results etc.
The file formats for the source files and the file in.dat are documented in the GRAL documentation, these are simple text files.

Alternatively reading the *.grz files:
Reading the *.grz files is a bit more complex, because these files are Zip containers, containing binary files with the result data in 3 more ore less complex formats. These file formats are very compact for storing large result files.
The compressed *.grz files are read in the routine ReadConFiles() in the file BackgroundWorker.cs. Besides the file name, this routine needs information about the GRAL area (boundaries, resolution, etc.) defined in the class BackgroundworkerData. The variable itm is a counter that specifies the internal number of the source group and conc is a three-dimensional array whose dimensions contain x and y indices and the source group number.

Writing the source files from the GUI:
The source data are stored in classes inside the folder GRALItemData. Each class has an IO method.

For the sake of simplicity I would take the approach not to use the GUI routines and work with the ASCii files instead.

Perhaps you can inform us about the results of the sensitivity analysis. We know that GRAL results for buildings and point sources depend very much on the position of the source. Maybe you can also check the new option Adaptive Roughness (included in V2009RC1), which brought significant improvements in our validation data sets.

Best regards
Markus

eta10 commented

Dear Mr. Markus,
Thank you so much for your help.
I prefer to use the ASCII files as well.
After writing the new specs of the source in point.dat and modifying the in.dat file, which cs code containing the model to link between the two files should I use in the below conditions?
In my case, I already have the gff files so these only need to be read not calculated. What I really need to automate could be done by the GUI as follows:

  • In the Computation Tab, use the "x" button to delete the con files.
  • In the same tab, run GRAL again for the existing gff files.
    Which cs code could then read the new point.dat and the existing gff files, then give me the new concentrations in ASCII file?

Dear eta10,
I would suggest a simple restart of GRAL after the changes, the GUI is not needed for this. GRAL overwrites existing files, so you don't need to delete them.
Starting GRAL works best with GRAL.dll, which is started using the console command "dotnet GRAL.dll" or the batch file Gral.bat (Windows) or GRAL.sh (LINUX).
Best regards
Markus

eta10 commented

Well noted Mr. Markus,
One last thing to confirm: if I restarted GRAL and the gff files are already there, would GRAL just read them or recalculate them? I am asking that for checking speed requirements.

If *.gff files are available, GRAL will read them.
Notes:
GRAL can only perform rudimentary plausibility tests (except for the latest *.gff format 2, which is only available in release candidate 20.09). This means if buildings or terrain would be changed, but not matching *.gff files are used, the calculation is not accurate. The GUI performs additional checks and issues warnings. In your case, it is your responsibility to ensure that buildings and grounds are not changed when using existing *.gff files.
I wish you every success for your project!

eta10 commented

Thank you so much for your support.

Best,
eta10