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

Meaning of MRF.correctBoundaryVelocity(U) and fvOptions(U) in the UEq file.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 28, 2016, 13:31
Question Meaning of MRF.correctBoundaryVelocity(U) and fvOptions(U) in the UEq file.
  #1
Member
 
Mirage
Join Date: Jul 2012
Posts: 43
Rep Power: 13
Mirage is on a distinguished road
I am using OF3.0.1 and I am trying to edit an already edited pisoFoam solver written in OF 2.3.

I wrote the UEq in a separate .H file. The solver is working but I am sure, if i am doing it correctly.

Here is what i wrote in the new UEq file:
Code:
turbulence->correct();    

fvVectorMatrix UEqn
(
    fvm::ddt(U)
  + fvm::div(phi, U)
  + turbulence->divDevReff(U)
 ==                                
    flowDirection*gradP            
);

UEqn.relax();

if (piso.momentumPredictor())    
{
    solve(UEqn == -fvc::grad(p));
}
and here is the new pisoFoam .C file:

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

        // Pressure-velocity PISO corrector
        {
            #include "UEqn.H"

            // --- PISO loop
            volScalarField rAU(1.0/UEqn.A());    
            while (piso.correct())
            {
                #include "pEqn.H"
                {
                    U.correctBoundaryConditions();
                }

            
         }
Here is the old pisoFoam solver:

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

       // #include "readPISOControls.H"
        #include "CourantNo.H"
    #include "setDeltaT.H" // added

    
    turbulence->correct();   

        // Pressure-velocity PISO corrector
        {
            // Momentum predictor

            fvVectorMatrix UEqn
            (
                fvm::ddt(U)
              + fvm::div(phi, U)
              + turbulence->divDevReff(U)
             ==                
        flowDirection*gradP   
            );

            UEqn.relax();

            if (momentumPredictor)
            {
                solve(UEqn == -fvc::grad(p));
            }
In the original pisoFoam (OF3.0.1) the UEq was also separated from the main .C file:

Code:
// Solve the Momentum equation

MRF.correctBoundaryVelocity(U);

fvVectorMatrix UEqn
(
    fvm::ddt(U) + fvm::div(phi, U)
  + MRF.DDt(U)
  + turbulence->divDevReff(U)
 ==
    fvOptions(U)
);

UEqn.relax();

fvOptions.constrain(UEqn);

if (piso.momentumPredictor())
{
    solve(UEqn == -fvc::grad(p));

    fvOptions.correct(U);
}
As you can see that UEq files look different. I was wondering, if I should use the functions
Code:
MRF.correctBoundaryVelocity(U);
and
Code:
fvOptions(U)
.

Please let me know if you need any other informations.

Any advice will be greatly appreciated, thanks in advance
Mirage is offline   Reply With Quote

Old   September 29, 2016, 02:55
Default
  #2
Member
 
Join Date: Sep 2014
Location: Germany
Posts: 88
Rep Power: 11
TobM is on a distinguished road
You only need these, if you want to use fvOptions or MRF. If not, you don't need them.
TobM 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



All times are GMT -4. The time now is 17:37.