CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Check mass continuity (http://www.cfd-online.com/Forums/openfoam-post-processing/61388-check-mass-continuity.html)

andimb March 22, 2006 06:42

Hi! Is there an easy way to
 
Hi!

Is there an easy way to check the mass continuity (incompressible) at the Inlet compared to the Outlet? I never wrote something in C++, so it would be hard to write some code. I'm just used to FORTRAN and Java.

If there's now easy way I could use the liftDrag tool as example, right? This is quit near to this.

The mass continuity for an incompressible flow is defined as div U = 0. Could I use that for a check.

Andreas

andimb March 22, 2006 09:11

Hi! I found the button in p
 
Hi!

I found the button in paraView to integrate over surfaces. So it is ok

Thanks
Andreas

hjasak March 23, 2006 07:39

Write a little code and do a s
 
Write a little code and do a sum of the fluxes, e.g.

sum(phi.boundaryField()[outletPatchIndex])

Remember, the flux going out is positive and the one going in is negative.

The local and global continuity data also gets reported during the run - have a look at your log file or the implementation. For incompressible flows src/cfdTools/incompressible/continuityErrs.H does the sum over all cells:


scalar sumLocalContErr = runTime.deltaT().value()*
mag(fvc::div(phi))().weightedAverage(mesh.V()).val ue();

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

Info<< "time step continuity errors : sum local = " << sumLocalContErr
<< ", global = " << globalContErr
<< ", cumulative = " << cumulativeContErr
<< endl;


Enjoy,

Hrv

tak April 13, 2006 11:20

Hi, I have calculate a tuto
 
Hi,

I have calculate a tutorial case "pitzDaily" with transports of chmical species (H2,O2,N2....) by means of reactingFoam (no reaction).
Could you please teach me how to calculate the material balances of chemical species ?

Now, I can calculate mass flow rates at the inlet and outlet like this:
label inletPatchi = mesh.boundaryMesh().findPatchID("inlet");
scalar inFlux = sum(phi.boundaryField()[inletPatchi]);
But I can't calculate mass flow rates of chemical species at the inlet and outlet.

Thanking you in advance for your help,

taka

tak April 14, 2006 03:02

Sorry, it's so easy to calcula
 
Sorry, it's so easy to calculate mass flow rate of chemical specie Y[i] at an inlet.

scalar inFlux =
sum(phi.boundaryField()[inletPatchi]
* sum(rho.boundaryField()[inletPatchi]
* Y[i];

Thanks.

suredross June 4, 2008 05:28

Hi all, i can see that phi(fl
 
Hi all,
i can see that phi(flux)is calculated for each time step and has entries for each cell.now comes the question:how does one verify that mass continuity and or conservation is achieved?is it by looking at the entries in the phi file and making sure that they are the same,taking into account the + and - signs correspond to outlet and inlet values?or am i totally wrong?
thanks for the help.

cheers
davey


All times are GMT -4. The time now is 04:01.