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

How to update phi in Fractional Step Method

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 22, 2017, 20:15
Default How to update phi in Fractional Step Method
  #1
Member
 
Join Date: Jul 2012
Posts: 67
Rep Power: 14
Carlen is on a distinguished road
Hi Foamers,

I intend to realise a semi-implicit fractional step in OpenFOAM but got stuck at the final step where the flux phi is updated. Please see the code here:
Code:
// Create Poisson Matrix
    fvScalarMatrix pEqn
    (
        fvm::laplacian(p)
    );
    pEqn.setReference(pRefCell, pRefValue);

// PressureCorrection.H 
    solve(pEqn==fvc::div(U)/runTime.deltaT());
    phi -= pEqn.flux();// This is where I have problem.
    U -= runTime.deltaT()*fvc::grad(p);
    U.correctBoundaryConditions();
According to Jasak, if there is a plus sign before laplacian (p) then it should be:
Code:
    phi -= pEqn.flux();
otherwise it should be

Code:
    phi += pEqn.flux();
However, I cannot get very good mass conservation from both of them. Or there are other ways to update flux? PS: I am solving momentum equation implicitly using second order backward.

Thanks for your help,

Carlen
Carlen is offline   Reply With Quote

Old   March 19, 2019, 09:31
Default
  #2
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
Quote:
Originally Posted by Carlen View Post
Hi Foamers,

I intend to realise a semi-implicit fractional step in OpenFOAM but got stuck at the final step where the flux phi is updated. Please see the code here:
Code:
// Create Poisson Matrix
    fvScalarMatrix pEqn
    (
        fvm::laplacian(p)
    );
    pEqn.setReference(pRefCell, pRefValue);

// PressureCorrection.H 
    solve(pEqn==fvc::div(U)/runTime.deltaT());
    phi -= pEqn.flux();// This is where I have problem.
    U -= runTime.deltaT()*fvc::grad(p);
    U.correctBoundaryConditions();
According to Jasak, if there is a plus sign before laplacian (p) then it should be:
Code:
    phi -= pEqn.flux();
otherwise it should be

Code:
    phi += pEqn.flux();
However, I cannot get very good mass conservation from both of them. Or there are other ways to update flux? PS: I am solving momentum equation implicitly using second order backward.

Thanks for your help,

Carlen
Did you solve this problem?
gu1 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
courant number increases to rather large values 6863523 OpenFOAM Running, Solving & CFD 22 July 6, 2023 00:48
Fractional Step Method and SIMPLE Ha Lim Choi Main CFD Forum 14 June 14, 2017 12:17
Convergence issue with Fractional Step Method using RK2 method for time integration mihirmakwana6 Main CFD Forum 23 June 6, 2015 07:58
Comparing between the Fractional step method and the SIMPLE method ghlee Main CFD Forum 1 April 10, 2012 17:59
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 03:58


All times are GMT -4. The time now is 21:29.