CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   globalContErr (http://www.cfd-online.com/Forums/openfoam/96811-globalconterr.html)

linch February 1, 2012 14:20

globalContErr
 
Hi,

I have a question to following lines in src/finiteVolume/cfdTools/incompressible/continuityErrs.H
Code:

volScalarField contErr = fvc::div(phi);
scalar globalContErr = runTime.deltaT().value()*
        contErr.weightedAverage(mesh.V()).value();

globalContErr should be an integral of the error over the complete domain volume and time step. fvc::div(phi) is a volume integral for each cell. Thus, time integration and summation over all cells is needed to obtain the global error. We already have the time integration *runTime.deltaT(), but why do we have averaging instead of summation over all cells?

Best regards,
Ilya

linch February 8, 2012 08:07

No ideas? :)

boger February 9, 2012 10:06

I don't have any answers for you, except to add my own observation that the localContErr would, I think, be equivalent to the L1-norm of the pressure equation residual were it not for the volume-averaging.

mm.abdollahzadeh July 28, 2012 08:07

Quote:

Originally Posted by linch (Post 342324)
Hi,

I have a question to following lines in src/finiteVolume/cfdTools/incompressible/continuityErrs.H
Code:

volScalarField contErr = fvc::div(phi);
scalar globalContErr = runTime.deltaT().value()*
        contErr.weightedAverage(mesh.V()).value();

globalContErr should be an integral of the error over the complete domain volume and time step. fvc::div(phi) is a volume integral for each cell. Thus, time integration and summation over all cells is needed to obtain the global error. We already have the time integration *runTime.deltaT(), but why do we have averaging instead of summation over all cells?

Best regards,
Ilya

Dear Linch

I have a small question which is not related to the topic.
I need to calclute a volscalerfield which is the time integral of another volscaler filed during my calculation. (e.g. sigma=int(PhiWE,t) )

I am new in OpenFoam. Should I do sth like this:

sigma=(PhiWE-sigma)*runTime.deltaT()


I will appreciate if you help me.


Best
Mahdi


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