|
[Sponsors] |
January 23, 2012, 01:43 |
Conservative form of Navier Stokes equation.
|
#1 |
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17 |
Hi,
I wish to modify the pimpleFoam solver for varying density. As a first step, I decided to change the momentum equation to the conservative form. To do so I changed the momentum equation to Code:
fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(phi, U) - fvm::laplacian(mu, U) - fvc::div(mu*dev2(fvc::grad(U)().T())) ); Code:
{ Info<<" In the most dreaded pEqn "<<endl; volScalarField rUA = 1.0/UEqn.A(); surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA)); U = rUA*UEqn.H(); phi = fvc::interpolate(rho)* ( (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi) ); surfaceScalarField buoyancyPhi = -rhorUAf*ghf*fvc::snGrad(rho)*mesh.magSf(); phi += buoyancyPhi; for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix p_rghEqn ( fvc::ddt(rho) + fvc::div(phi) - fvm::laplacian(rhorUAf, p_rgh) ); p_rghEqn.solve ( mesh.solver ( p_rgh.select ( ( finalIter && corr == nCorr-1 && nonOrth == nNonOrthCorr ) ) ) ); if (nonOrth == nNonOrthCorr) { // Calculate the conservative fluxes phi += p_rghEqn.flux(); // Explicitly relax pressure for momentum corrector p_rgh.relax(); // Correct the momentum source with the pressure gradient flux // calculated from the relaxed pressure U += rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rhorUAf); } } p = p_rgh + rho*gh; DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.0 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object rho; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -3 0 0 0 0 0]; internalField uniform 1000; boundaryField { outlet { type fixedValue; value uniform 1000; } inlet { type fixedValue; value uniform 1000; } wall { type fixedValue; value uniform 1000; } frontBack { type empty; } } // ************************************************************************* // 0/rho (END) |
|
January 24, 2012, 12:22 |
|
#2 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Take a look at rhoPimpleFoam, and for a solver using p_rgh, you could take a look at buoyantPimpleFoam.
Best,
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
|
January 25, 2012, 09:33 |
Solved.
|
#3 |
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17 |
thanks for d help.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding a term to Navier Stokes Equation | ashtonJ | CFX | 3 | January 15, 2011 07:32 |
coupling KE equation with navier stokes equation | prashant | FLUENT | 0 | March 7, 2008 08:05 |
Full navier stokes Equation descretized form | rawin | Main CFD Forum | 1 | September 21, 2005 13:42 |
Newbie:Viscoelasticity and Navier stokes equation | Rajil Saraswat | Main CFD Forum | 2 | June 9, 2003 08:21 |
1-d navier stokes equation | Robert | Main CFD Forum | 0 | December 20, 2002 03:14 |