CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   How to simulate on geometry with curvature (http://www.cfd-online.com/Forums/openfoam/96161-how-simulate-geometry-curvature.html)

seboxx January 14, 2012 06:51

How to simulate on geometry with curvature
 
1 Attachment(s)
Hi Foamers,

I have created a bump using blockMesh.
Visually everything works out nice, I mean I can see the bump in ParaFoam and it looks as i intended it to look. (see attached jpg)
But the problem is, the simulations i run are not correct. Actually it is just the same as if I would just run it on a disc with equal radius.

For example I need to calculate the volume of the domain at some point during the simulation. No matter whether I use domainIntegrate, volumeIntegrate or sum(mesh.V().field()) I get the volume 1256.62, which is exactly pi * r^2
At first I thought this is a problem of the domainIntegrate function or whatever.
But doing simulations of localized structures that should definitely feel the curvature it just goes through as if it would be flat.

I am using pisoFoam, i think I have just modified the pisoFoam source code to my needs... Is it possible that I need additional libraries to calculate on curved meshes? Do I need another solver as a base code?

Also checkMesh reports that the Mesh is ok and the solver doesn't give any error message...

I am happy about any suggestion


Here is the code:
Code:


#include "fvCFD.H"


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

int main(int argc, char *argv[])
{
    #include "setRootCase.H"

    #include "createTime.H"
    #include "createMesh.H"
    #include "createFields.H"
  //#include "initContinuityErrs.H"
  //#include "fvcVolumeIntegrate.H"   
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    Info<< "\nStarting time loop\n" << endl;


    while (runTime.loop())
      {
        Info<< "Time = " << runTime.timeName() << nl << endl;

        #include "readPISOControls.H"
       
        // --- PISO loop
       
        for (int corr=0; corr<nCorr; corr++)
        {
          // #include "uEqn.H"
          // #include "vEqn.H"           
        }
         
        Info<< "sum(mesh.V().field())= " << sum(mesh.V().field()) << endl;
        Info<< "domainIntegrate= " << fvc::domainIntegrate(pos(u-(1e-12))) <<endl;
        Info<< "volumeIntegrate= " << sum(fvc::volumeIntegrate(pos(u-(1e-12)))) <<endl;
       
        //        outputDict.set("S",scale_spaceunit*fvc::volumeIntegrate(pos(u-(1e-12))));
        runTime.write();
       
            Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
            << nl << endl;
      }

    Info<< "End\n" << endl;

    return 0;
}

Best regards,

seb

seboxx January 18, 2012 05:43

1 Attachment(s)
Hmm, or is it a problem with my blockMeshDict?

I have tried the same geometry with modified Versions of icoFoam and simpleFoam. The modification was only
Code:

sum(mesh.V().field())
and the result was the same. The volume of a flat plate...

Hmm checkMesh says Mesh Ok. But I realised that the wrong total volume already appears there...

Please find my blockMeshDict attached. I would be happy about any suggestions...

Regards

seb


All times are GMT -4. The time now is 00:03.