CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Forces not calculated when including a library in controlDict (https://www.cfd-online.com/Forums/openfoam/88260-forces-not-calculated-when-including-library-controldict.html)

fusij May 12, 2011 06:49

Forces not calculated when including a library in controlDict
 
Hello,

The forces are not calculated when I include my own library in the controlDict. It seems like that nothing is run in the controlDict after I include the library. Here is my controlDict:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.3                                  |
|  \\  /    A nd          | Web:      http://www.openfoam.org              |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version        2.0;
    format          ascii;
    class          dictionary;
    object          controlDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

applicationClass turbDyMFoam;

startFrom      startTime;

startTime      0;

stopAt          endTime;

endTime        1.0000;

deltaT          0.005;

writeControl    adjustableRunTime;

writeInterval  0.02;

cycleWrite      0;

writeFormat    ascii;

writePrecision  7;

writeCompression uncompressed;

timeFormat      general;

timePrecision  7;

runTimeModifiable yes;

adjustTimeStep yes;

maxCo          0.5;

maxDeltaT      1.0;

libs ("libmydynamicFvMesh.so")

functions
(
        forces
        {
                type forces;
                functionObjectLibs ("libforces.so");
                outputControl outputTime;

                // Patches to sample
                patches (blade);
        // Name of fields
                pName p;
                Uname U;
        // Dump to file
                log true;
        // Density
                rhoName rhoInf;
                rhoInf 1000; //Reference density for fluid
        // Centre of rotation
                CofR (0 0 0.3);
}
);

Does someone know the way around this problem and can tell me what to do? I am using OF-1.5-dev.

Thank you.

fusij May 12, 2011 11:56

This is rather urgent and I would be very grateful if someone had any ideas or comments.

I need the forces calculations since I want to calculate a moment on a patch.

andrea.pasquali May 13, 2011 07:25

Try this, it works for me:
Quote:

forcesBlade_2
{
type forces;
functionObjectLibs ("libforces.so");
verbose true;
log true;
patches ( blade_2_NEW );
rhoName rhoInf;
rhoInf 1.225;
CofR (0 0 0);
outputControl timeStep;
outputInterval 1;
}
It calculates forces for each time step

Andrea


All times are GMT -4. The time now is 19:10.