CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   How to include parameters in setSet (http://www.cfd-online.com/Forums/openfoam/96973-how-include-parameters-setset.html)

MasterCooler February 6, 2012 11:37

How to include parameters in setSet
 
Dear all,

I am looking for a way to include parameters while setSet is running.

I execute the following command:
Code:

setSet -batch setSetDict
whereby the setSetDict file contains:
Code:

#include "../_globaleParameter/globPars"
cellZoneSet rotor new cylinderToCell (-1 0 1) (1 0 -1) $dRot

and the globPars file contains
Code:

#inputMode merge
dRot  70;

I got the following error message:
Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.x_20120105                        |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.1.x_20120105-eb976ba31c36
Exec  : setSet -batch system/setSetDict
Date  : Feb 06 2012
Time  : 16:19:29
Host  : ""
PID    : 30371
Case  :
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Time:0  cells:3458273  faces:10683541  points:3791497  patches:5  bb:(-300 -225 -120) (900 225 225)

Time = 0
    mesh not changed.
Reading commands from file "system/setSetDict"
Please type 'help', 'quit' or a set command after prompt.
Doing:"#include \"../_globaleParameter/globPars\""
Doing:"cellZoneSet rotor new cylinderToCell (-1 0 1) (1 0 -1) $dRot"
    Set:rotor  Size:0  Action:new
wrong token type - expected Scalar, found on line 0 the word '$dRot'

    Usage: cylinderToCell (p1X p1Y p1Z) (p2X p2Y p2Z) radius

    Select all cells with cell centre within bounding cylinder


End

In earlier versions the command cellSet (or faceSet) was used and it was never a problem to include parameters in cellSetDicts. Has anybody a solutions for that problem?

Thanks in advance.

Cheers
Ben

wyldckat February 6, 2012 18:06

Greetings Ben,

setSet works as a batch/script application, that is why you can't #include stuff in each batch file.
The closest application that now exists with similar functionality is topoSet.

If you still want to use setSet, then you'll need a middle step and change the way you define the values. For example:
  1. In "globPars":
    Code:

    dRot=70
  2. The file "setSetDict" you have is renamed to "setSetDict.template".
  3. In a shell script named "setIt.sh", have something like this:
    Code:

    #!/bin/sh
    source globPars
    rm setSetDict
    cat "setSetDict.template" | while read line; do
      eval echo $line >> setSetDict
    done
    setSet -batch setSetDict

    I haven't tested this, but it should work.
Best regards,
Bruno

MasterCooler February 7, 2012 07:23

Hey Bruno,

thanks a lot, topoSet is exactly that what I looked for. Forget setSet ;-)

Cheers
Ben


All times are GMT -4. The time now is 05:28.