Utilities

Figure 1.1 shows the architecture of utilities.

meshPorosity

meshPorosity is a post-processor that computes and print the total volume, fibers volume, voids volume and porosity. It works considering that the total domain is composed by a porous domain surrounded by two buffer zones. To identify the porous domain, the script search for a patch named fibres. This utility also works in the case of a porous domain only (no buffer zones). In this configuration, the fibres patch is useless. Listing [lis:meshPorosity] shows meshPorosity usage.

$ meshPorosity

patoManager

Listing [lis:help] shows how to print the patoManager help.
$ patoManager -h
Usage: patoManager [OPTIONS]
options:
  -addAllTests      Add all the new test files (*.C) from
                    "$LIB_PATO/src/applications/tests/testsuites"
                    to the unit testing framework
  -addBC <oldBCName/newBCName>
                    Add new BC (copy of old BC)
  -addType <modelName/oldTypeName/newTypeName>
                    Add new type (copy of old type)
  -cleanTuto <tutoDir>
                    Clean the tutorials in <tutoDir>
                    (N.B. use "all" to clean
                    all the tutorials)
  -listModels       List the available models
  -listTypes        List the available models and related types
  -removeBC <BCName>
                    Remove BC
  -removeType <modelName/typeName>
                    Remove type
  -runTest <args>   Run unit test suites
  -runTuto <tutoDir>
                    Run the tutorials in <tutoDir>
                    (N.B. use "all" to run all
                    the tutorials)
  -saveTest <tutoDir>
                    Save the reference tutorials from <tutoDir> to
                    $PATO_DIR/src/applications/tests/
                    testsuites/tutorials/ref
  -showDoc <browser>
                    Show PATO documentation generated by Doxygen

Cleaning/running tutorials

Listing [lis:runTuto] shows how to run all the tutorials in the tutorials/1D folder. Listing [lis:cleanTuto] shows how to clean all the tutorials in the tutorials/1D folder.

$ patoManager -runTuto "1D"
$ patoManager -cleanTuto "1D"

Adding/removing types

Listing [lis:models] shows how to list the different material sub-models. Listing [lis:types] shows how to list the different types per material sub-model. Listing [lis:addType] shows how to add a new type based on a old type of a given material sub-model. Listing [lis:addType] shows how to remove a type based of a given material sub-model.

$ patoManager -listModels
    Available models are:
        9
        (
            Energy
            GasProperties
            IO
            Mass
            MaterialChemistry
            MaterialProperties
            Pyrolysis
            TimeControl
            VolumeAblation
        )
$ patoManager -listTypes
    Available types for EnergyModel:
        7
        (
            BoundaryTable
            CorrectBC
            FixedTemperature
            PureConduction
            Pyrolysis
            Pyrolysis_Heterogeneous_SpeciesDiffusion
            no
        )
    ...
$ patoManager -addType "Energy/Pyrolysis/newModelName"
$ patoManager -removeType "Energy/modelName"

Adding boundary conditions

Listing [lis:addBC] shows how to add new boundary conditions based on old ones.

$ patoManager -addBC "speciesBC/newBCname"

Showing Doxygen documentation

Listing [lis:showdoc] shows how to display the PATO Doxygen documentation.

$ patoManager -showDoc "firefox"

inletPower

inletPower is a post-processor that computes the power on a specified field. Reference temperature, patch and temperature field name should be provided. You should provide the region name. You can select which time step you want to post process. Listing [lis:inletPower] shows inletPower usage.

$ inletPower -Tfield "Ta" -Tref 300 -field "U" "patch"

storedEnergy

storedEnergy is a post-processor that computes the stored energy on solid phase. Reference temperature, temperature field name and region name should be provided. You can select which time step you want to post process. Listing [lis:storedEnergy] shows storedEnergy usage.

$ storedEnergy -Tfield "Ta"

postProcessTime

postProcessTime creates a file that contains field values as a function of time from the files in postProcessing directory. Listing [lis:postProcessTime] shows postProcessTime usage.

$ postProcessTime "dictName" "regionName" "inputFileName" "outputFileName"

processSets

processSets is run after OpenFOAM post-processor sample to grab cloud data in the sets directory and rewrite them in a single file. Currently, it can only extract data from list_Ta_rho_s file. Listing [lis:processSets] shows processSets usage.

$ processSets

processSetsName

processSetsName is an extended version of processSets where you can provide name of the input and output files, number of probe fields, switch to allow moving probes and region name. Listing [lis:processSetsName] shows processSetsName usage.

$ processSetsName -npf 2 -movingProbe 0 -region "porousMat" "input" "output"

tutoInDevelopment

tutoInDevelopment is used to send an error message and then stop the run of a tutorial in development. The tutorial will run normally if the debug flag is yes allowing the continuation of the development. Listing [lis:tutoInDevelopment] shows tutoInDevelopment usage.

$ tutoInDevelopment -debug "no" -errorMsg "This tutorial is in development."

The tutoInDevel.sh script was added to PATH to simplify the usage of tutoInDevelopment by allowing default arguments. Listing [lis:Allrun:utilities:tutoInDevel] shows how to call the tutoInDevel.sh script in the Allrun tutorial file and Listing [lis:tutoInDevel.sh] shows its usage.

cd ${0%/*} || exit 1    # Run from this directory
eval `tutoInDevel.sh`   # Tutorial in development
$ ./Allrun "no" "This tutorial is in development."

patoCodingStyle

Listing [lis:patoCodingStyle] shows how to format the C++ code in PATO. This utility needs to be run before a commit.

$ patoCodingStyle -dir "$PATO_DIR" # -format yes -verbose

tests

tests directory contains the testing framework and testing suite. The unit tests can be run through the runtests executable. During the tests, the outputs from the models and tutorials are compared to reference files located in testsuites directory. Listing [lis:runtests] shows runtests usage.

$ runtests # -h for help

Listing [lis:test_example] shows an output example of successful unit testing (TestIOFunctions).

[-- TestIOFunctions -- Test 1 / 4: Success -- ClockTime = 00h00m03s --]
[-- TestIOFunctions -- Test 2 / 4: Success -- ClockTime = 00h00m03s --]
[-- TestIOFunctions -- Test 3 / 4: Success -- ClockTime = 00h00m03s --]
[-- TestIOFunctions -- Test 4 / 4: Success -- ClockTime = 00h00m03s --]