CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Q:write value at each time step from actuator disc source term (https://www.cfd-online.com/Forums/openfoam-solving/240172-q-write-value-each-time-step-actuator-disc-source-term.html)

Kbshariff December 15, 2021 09:27

Q:write value at each time step from actuator disc source term
 
Hi,

I am running a simulation of a tidal turbine using an actuator disc. The actuator disc source term in openfoam is calculated using a variableScaling method defined in fvOptions

the thrust coefficient is calculated as
Code:

const scalar CtStar = Ct*sqr(magUref/magUdisk);
the source term is calculated as
Code:

    // Compute calibrated thrust/power (LSRMTK:Eq. 5)
    const scalar T = 0.5*rhoRef*diskArea_*magSqr(Udisk & diskDir_)*CtStar;


as shownhere

How can I write the value of CtStar for each timestep that is calculated?

I tried to use functionObjLib in control dict but CtStar is not defined in the list of

Code:

    testing
    {
        type writeRegisteredObject;
        functionObjectLibs ( "libIOFunctionObjects.so" );
        objectNames ("bananas");
        outputControl    outputTime;
    }

Thank you

Kbshariff December 15, 2021 11:31

Hello,

I was able to write the CtStar at every timestep. It was trivial!!!

I added a line to the fvOptions
Code:

    writeToFile    true;
and the result is given as a data file in postprocessing


All times are GMT -4. The time now is 12:58.