Skip to content

ExtInput

lukas edited this page May 19, 2017 · 1 revision

Table of Contents

External data in .csv-Files

External files can be loaded in .csv Format. These files are values divided by commata in one line. This format is described in parameter space section for example.

Including external FDS-Files

Sometimes it might be useful to create an FDS-File and then just add some contents with FDSgeogen. So it is possible to include an external FDS-file with FDSgeogen. To include external FDS-Files use the input tag:

<input from_file="ext_file.fds"/>

Note, that if nothing more is prescribed the complete FDS-File will be inserted into the new file. The following lines demonstrate what happens:

<fds>

    <info chid="'testfile'" outfile="'include.fds'" />

    <input from_file="'testfile121.fds'"/>

    <section id="devc">
        <loop var="ix" start="0" stop="3">
            <var devcposx="ix+1"/>
            <var devcposy="1"/>
            <var devcposz="1" />
            <device x="devcposx" y="devcposy" z="devcposz" q="'TEMPERATURE'" id="'TEMP_X%i' %(ix)"/>
        </loop>

        
    </section>
    
</fds>

The following lines will be created when using the command like this:

&HEAD CHID='testfile', TITLE='title' /

 == insertion from file: testfile121.fds == 
&HEAD CHID='testfile111', TITLE='title' /
&TIME T_END=30.0 /
&MESH IJK=12,18,9, XB=0.000000,2.400000,0.000000,3.600000,0.000000,1.800000 /
&TAIL/
== end of insertion == 

&DEVC ID='TEMP_X0', XYZ=1.000000,1.000000,1.000000, QUANTITY='TEMPERATURE'/
&DEVC ID='TEMP_X1', XYZ=2.000000,1.000000,1.000000, QUANTITY='TEMPERATURE'/
&DEVC ID='TEMP_X2', XYZ=3.000000,1.000000,1.000000, QUANTITY='TEMPERATURE'/
&TAIL/

As you can see, the HEAD and TAIL commands are inserted as well. This will cause errors in FDS. To fix this problem it is possible to include or exclude certain FDS-Inputs. In this case we can either include the FDS-commands TIME and MESH or exclude the commands HEAD and TAIL. this can be done with the following lines:

<input from_file="'testfile121.fds'" incl="'TIME', 'MESH'"/>

or

<input from_file="'testfile121.fds'" excl="'HEAD', 'TAIL'"/>

Both versions create the following FDS-Code:

&HEAD CHID='testfile', TITLE='title' /

 == insertion from file: testfile121.fds == 
&TIME T_END=30.0 /
&MESH IJK=12,18,9, XB=0.000000,2.400000,0.000000,3.600000,0.000000,1.800000 /
== end of insertion == 

&TIME T_END=30.0 /
&DEVC ID='TEMP_X0', XYZ=1.000000,1.000000,1.000000, QUANTITY='TEMPERATURE'/
&DEVC ID='TEMP_X1', XYZ=2.000000,1.000000,1.000000, QUANTITY='TEMPERATURE'/
&DEVC ID='TEMP_X2', XYZ=3.000000,1.000000,1.000000, QUANTITY='TEMPERATURE'/
&TAIL/

Note that you have to choose either inclusion or exclusion, both at the same time is not possible.

Using FDS-Files as template for parameter variation

In some cases the user might want to study the influence of a set of parameters on a given scenario. For this an FDS-File can be created as a template, containing keywords for the parameters to be changed. To import the template the following input tag shall be used:

<input replace_file="'template1.fds'">

As an example a simple burner setup was choosen. The parameter to change is the energy release rate per unit area HRRPUA, starting at 500 kW/m² and increase in four steps to 2000 kW/m². This example can be found as 'basic_replace' in the 'examples' folder. The example template looks like the following:

&MESH IJK=40,40,40, XB=-2,2,-2,2,0,4 /  

&TIME T_END=60. /  

&REAC FUEL='PROPANE', SOOT_YIELD=0.015 /

&SURF ID='BURNER', HRRPUA=#err# /

&VENT XB=-0.6,0.6,-0.6,0.6,0,0, COLOR='RED', SURF_ID='BURNER' /

&VENT MB='ZMAX',SURF_ID='OPEN'/
&VENT MB='YMIN',SURF_ID='OPEN'/
&VENT MB='YMAX',SURF_ID='OPEN'/
&VENT MB='XMIN',SURF_ID='OPEN'/
&VENT MB='XMAX',SURF_ID='OPEN'/

The template FDS-File contains a keyword #err# for HRRPUA. This keyword is looked for by FDSgeogen and replaced as defined in the XML-File. This is not resricted to only one parameter, it is also possible to change multiple parameters. For instance material properties, like density and heat of combustion, could be changed, too. The accompanying XML-File looks like this:

<fds>

    <!-- FDS input file naming -->
    <info chid="'basic_replace'" outfile="'basic_replace.fds'" subdir="'id_%03d'%para_id" title="'Show case of the replace function for FDSgeogen.'" />

	<!--list of different energy release rates /-->
	<para dim='d1' var='err' list='np.linspace(500.0,2000.0,4)' />

    <!-- inclusion of information from an external template file -->
    <input replace_file="'template1.fds'">
      <replace from="#err#" to="err" />
    </input>
	
</fds>

It contains general information to name the files and create subfolders for different cases. Furthermore the parameter is defined and a list of values is given. In the following step the name of the template file is given and the keyword #err# is defined. As a result four FDS-Files in subfolders are created.

One of the created FDS-Files is shown here:

&HEAD CHID='basic_replace', TITLE='Show case of the replace function for FDSgeogen.' /


&MESH IJK=20,20,20, XB=-2,2,-2,2,0,2 /  

&TIME T_END=60. /  

&REAC FUEL='PROPANE', SOOT_YIELD=0.015 /

&SURF ID='BURNER', HRRPUA=1000.0 /

&VENT XB=-0.6,0.6,-0.6,0.6,0,0, COLOR='RED', SURF_ID='BURNER' /

&VENT MB='ZMAX',SURF_ID='OPEN'/
&VENT MB='YMIN',SURF_ID='OPEN'/
&VENT MB='YMAX',SURF_ID='OPEN'/
&VENT MB='XMIN',SURF_ID='OPEN'/
&VENT MB='XMAX',SURF_ID='OPEN'/


&TAIL/

Clone this wiki locally