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

developing icofoam in non-inertial system

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 20, 2012, 21:45
Default developing icofoam in non-inertial system
  #1
New Member
 
Join Date: Aug 2011
Posts: 1
Rep Power: 0
luckygl is on a distinguished road
hello everybody,
I try to use non-inertial system to solve heaving elliptic plate.

My present case is very simple.It's a 2D elliptic plate heaving cosinely.I add a source term into the N-S equation developing icoFoam.My boundary conditions also are changed into non-inertial system.

The new solver can be compiled and run successfully.But the result is totally wrong.I don't know where the problem is.

I attach my test case, so that someone who know this (which is not really difficult ;-)) can give me a hint.

Best regards and thanks in advance for any reply
Monica

PS:here is my solver
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"
    volVectorField Ftmp = F;//store the initial value of F
    volVectorField Uetmp = Ue;//store the entangling velocity
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    Info<< "\nStarting time loop\n" << endl;
    while (runTime.loop())
    {
        Info<< "Time = " << runTime.timeName() << nl << endl;
        #include "readPISOControls.H"
        #include "CourantNo.H"

        dimensionedScalar t = runTime.value();// get current time
        F = Ftmp * cos(omega * t);//modify F of the internal field
        F.correctBoundaryConditions();//correct the boundary values
 
        fvVectorMatrix UrelEqn
        (
            fvm::ddt(Urel)
          + fvm::div(phi, Urel)
          - fvm::laplacian(nu, Urel)
          + F//add the source item
        );
        solve(UrelEqn == -fvc::grad(p));
        // --- PISO loop
        for (int corr=0; corr<nCorr; corr++)
        {
            volScalarField rAUrel(1.0/UrelEqn.A());
            Urel = rAUrel*UrelEqn.H();
            phi = (fvc::interpolate(Urel) & mesh.Sf())
                + fvc::ddtPhiCorr(rAUrel, Urel, phi);
            adjustPhi(phi, Urel, p);
            for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
            {
                fvScalarMatrix pEqn
                (
                    fvm::laplacian(rAUrel, p) == fvc::div(phi)
                );
                pEqn.setReference(pRefCell, pRefValue);
                pEqn.solve();
                if (nonOrth == nNonOrthCorr)
                {
                    phi -= pEqn.flux();
                }
            }
            #include "continuityErrs.H"
            Urel -= rAUrel*fvc::grad(p);
            Urel.correctBoundaryConditions();

    //---update absolute velocity
     Ue=Uetmp * sin(omega * t);
     Ue.correctBoundaryConditions();//correct the boundary values
     Uabs = Urel + Ue;
 }
        runTime.write();
        Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
            << nl << endl;
    }
    Info<< "End\n" << endl;
    return 0;
}

// ************************************************************************* //
Attached Files
File Type: zip F+Ue.zip (81.7 KB, 4 views)
File Type: zip case.zip (11.1 KB, 4 views)
luckygl is offline   Reply With Quote

Old   March 2, 2021, 12:42
Default
  #2
New Member
 
tomas lopez olocco
Join Date: Dec 2020
Posts: 4
Rep Power: 5
tomi_foamer is on a distinguished road
Hi,
did you solve it? I have a similar problem that im not able to solve it.
Thanks!
tomi_foamer is offline   Reply With Quote

Reply

Tags
heaving plate, icofoam, non-inertial system


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
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 19:56
Need ideas-fuel discharge system Jan FLUENT 1 October 11, 2006 00:05
Need ideas-fuel discharge system Jan CFX 1 October 9, 2006 09:16
need ideas-fuel discharge system Jan Siemens 0 October 9, 2006 05:31
Need ideas-fuel discharge system Jan Main CFD Forum 0 October 9, 2006 05:27


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