CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to calc time devirative of a scalar (http://www.cfd-online.com/Forums/openfoam-solving/60145-how-calc-time-devirative-scalar.html)

chris1980 June 23, 2006 04:42

I want to do a volume average
 
I want to do a volume average of volScalarField and from this scalar I want to calc the time devirative.

I have tried:

scalar dpmdt = ddt(p.weightedAverage(mesh.V()).value());

but the ddt function does not allow a scalar argument.

How can I do this?

hjasak June 23, 2006 13:50

Basically, by hand: store seve
 
Basically, by hand: store several scalars and calculate the ddt directly from their values. A scalar variable is just a float (or a double) and it does not record its own history.

Hrv


All times are GMT -4. The time now is 06:52.