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

how to add correct( ) in Foam.C to update functions?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 17, 2016, 21:28
Question how to add correct( ) in Foam.C to update functions?
  #1
New Member
 
popovich
Join Date: Jan 2016
Posts: 9
Rep Power: 3
popovich is on a distinguished road
Sponsored Links
Dear members, my functins rho1() rho2() p() are as follows:

virtual const volScalarField& rho1() const
{
return alpha1_.db().lookupObject<volScalarField>("rho1");
}

virtual const volScalarField& rho2() const
{
return alpha2_.db().lookupObject<volScalarField>("rho2");
}

virtual const volScalarField& p() const
{
return alpha1_.db().lookupObject<volScalarField>("p");
}



Foam.C are as follows:


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

while (runTime.run())
{
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"

runTime++;

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

// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
            
    #include "alphaEqnsSubCycle.H"
// correct interface on first PIMPLE corrector
if (pimple.corr() == 1)
{
interface.correct();
}

solve(fvm::ddt(rho) + fvc::div(rhoPhi));

#include "UEqn.H"
#include "TEqn.H"

// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}

if (pimple.turbCorr())
{
turbulence->correct();
}
}

runTime.write();

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}

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

return 0;
}
popovich is offline   Reply With Quote
Sponsored Links

Old   May 17, 2016, 21:35
Default
  #2
New Member
 
popovich
Join Date: Jan 2016
Posts: 9
Rep Power: 3
popovich is on a distinguished road
how to add correct() in Foam.C to update rho1() rho2() p() ?
popovich is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Where are correct () and update() functions defined ? sasanghomi OpenFOAM 5 August 16, 2013 09:49
Is my Dynamic mesh setup correct? cfd seeker FLUENT 14 January 26, 2013 15:01
Using Workbench, CFX-Pre doesn't update mesh from upstream data Shawn_A CFX 2 November 25, 2012 14:06
How to add temperature to icoFoam - correct? uli OpenFOAM Programming & Development 3 July 31, 2012 16:48

Sponsored Links


All times are GMT -4. The time now is 13:54.