CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Relative flux in pimpleDyMFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 20, 2011, 17:50
Default Relative flux in pimpleDyMFoam
  #1
New Member
 
Join Date: Jun 2011
Posts: 3
Rep Power: 14
Igor_2011 is on a distinguished road
Hi Foamers!

I've recently been trying to simulate the plunge motion of a 2D cylinder using pimpleDyMFoam and the rigid body deformation technique, or solidBodyMotionFvMesh. Although the simulations converge, I noticed that the entire flow solution moved with the cylinder, which is not very physical!

I started to think about this issue and the first thing that came out to my mind was that there may have an issue with the part of the code that should make the flow relative to the mesh motion. However, when I looked at the files (see the code below) everything looked correct to me since at the beginning of each iteration the fluxes are made absolute, then the mesh position is updated before make the flux relative again.

Any one has a clue regarding this issue?

Great thanks!


Code:

    // Make the fluxes absolute
        fvc::makeAbsolute(phi, U);

        #include "setDeltaT.H"

        runTime++;

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

        mesh.update();

        if (mesh.changing() && correctPhi)
        {
            #include "correctPhi.H"
        }

        // Make the fluxes relative to the mesh motion
        fvc::makeRelative(phi, U);

        if (mesh.changing() && checkMeshCourantNo)
        {
            #include "meshCourantNo.H"
        }

        // --- PIMPLE loop
        for (int ocorr=0; ocorr<nOuterCorr; ocorr++)
        {
            if (nOuterCorr != 1)
            {
                p.storePrevIter();
            }

            #include "UEqn.H"

            // --- PISO loop

            for (int corr=0; corr<nCorr; corr++)
            {
                rAU = 1.0/UEqn.A();

                U = rAU*UEqn.H();
                phi = (fvc::interpolate(U) & mesh.Sf());

                if (p.needReference())
                {
                    fvc::makeRelative(phi, U);
                    adjustPhi(phi, U, p);
                    fvc::makeAbsolute(phi, U);
                }

                for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
                {
                    fvScalarMatrix pEqn
                    (
                        fvm::laplacian(rAU, p) == fvc::div(phi)
                    );

                    pEqn.setReference(pRefCell, pRefValue);

                    if
                    (
                        ocorr == nOuterCorr-1
                     && corr == nCorr-1
                     && nonOrth == nNonOrthCorr)
                    {
                        pEqn.solve(mesh.solver(p.name() + "Final"));
                    }
                    else
                    {
                        pEqn.solve(mesh.solver(p.name()));
                    }

                    if (nonOrth == nNonOrthCorr)
                    {
                        phi -= pEqn.flux();
                    }
                }

                #include "continuityErrs.H"

                // Explicitly relax pressure for momentum corrector
                if (ocorr != nOuterCorr-1)
                {
                    p.relax();
                }

                // Make the fluxes relative to the mesh motion
                fvc::makeRelative(phi, U);

                U -= rAU*fvc::grad(p);
                U.correctBoundaryConditions();
            }

            turbulence->correct();
        }
Igor_2011 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wind turbine simulation Saturn CFX 58 July 3, 2020 01:13
Problem setting with chtmultiregionFoam Antonin OpenFOAM 10 April 24, 2012 09:50
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 04:05
What is the problem with the relative Flux Correction danielle OpenFOAM Running, Solving & CFD 0 November 1, 2008 23:24
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 20:09


All times are GMT -4. The time now is 07:47.