CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Attempt to implement the Chorin Projection Method (https://www.cfd-online.com/Forums/openfoam-programming-development/125476-attempt-implement-chorin-projection-method.html)

McFly October 26, 2013 06:46

Attempt to implement the Chorin Projection Method
 
Hello,

As above, I'm attempting to implement the Chorin Projection Method in OpenFOAM. This is my first time playing with solvers, I'm taking most of my information from the paper, "On the Implementation of Low-Dissipative, Fractional Step Methods for Transient Flows Using OpenFOAM" V Vuorinen, J.-P Keskinen, C Duwig, O Kaario, M Larmi, B J Boersma.

I have code that compiles but doesn't work. It blows up. Although I can see the results are clearly wrong in paraFoam, the equations seem sound based on the above paper and other reading.

Can you help me find what I'm missing? I've been searching for days and haven't found a complete implementation of the code to look at.

Cheers,


Marty

Code:

    phi = fvc::interpolate(U) & mesh.Sf();

    dU = (-fvc::div(phi)*U + nu*fvc::laplacian(U))*runTime.deltaT();

    U = U + dU;

    U.correctBoundaryConditions();

    phi = fvc::interpolate(U) & mesh.Sf();

    solve(fvm::laplacian(p) == fvc::div(phi)/runTime.deltaT());

    U = U - runTime.deltaT()*fvc::grad(p);

    U.correctBoundaryConditions();



All times are GMT -4. The time now is 05:58.