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

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 17, 2016, 22:28
Question how to add correct( ) in Foam.C to update functions?
  #1
New Member
 
popovich
Join Date: Jan 2016
Posts: 9
Rep Power: 10
popovich is on a distinguished road
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

Old   May 17, 2016, 22:35
Default
  #2
New Member
 
popovich
Join Date: Jan 2016
Posts: 9
Rep Power: 10
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


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
Is my Dynamic mesh setup correct? cfd seeker FLUENT 16 October 30, 2020 07:16
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Where are correct () and update() functions defined ? sasanghomi OpenFOAM 5 August 16, 2013 10:49
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 17:48


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