|
[Sponsors] |
April 3, 2015, 02:41 |
adding gravity term in pisoFoam
|
#1 |
New Member
Chaewoong Ban
Join Date: Jun 2013
Posts: 18
Rep Power: 13 |
Hi
I'm being set up the LES model for the channel flows. At first, I refer to channelFoam. However, in its driving force for the flows is pressure gradients. but I would like to consider the gravity term for the driving force. So, I added a new term to the original pisoFoam. But I'm not sure my attempt. My code is as follows. I'll thank you any advice. ## pisoFoam.c while (runTime.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; #include "readPISOControls.H" #include "CourantNo.H" // Pressure-velocity PISO corrector { // Momentum predictor fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) // == // Gravity ); UEqn.relax(); if (momentumPredictor) { solve(UEqn == -fvc::grad(p)+Gravity2); //corrected } // --- PISO loop for (int corr=0; corr<nCorr; corr++) { volScalarField rAU(1.0/UEqn.A()); volVectorField HbyA("HbyA", U); HbyA = rAU*(UEqn.H()+Gravity2); //corrected surfaceScalarField phiHbyA ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p); // Non-orthogonal pressure corrector loop for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { // Pressure corrector fvScalarMatrix pEqn ( fvm::laplacian(rAU, p) == fvc::div(phiHbyA) ); pEqn.setReference(pRefCell, pRefValue); if ( corr == nCorr-1 && nonOrth == nNonOrthCorr ) { pEqn.solve(mesh.solver("pFinal")); } else { pEqn.solve(); } if (nonOrth == nNonOrthCorr) { phi = phiHbyA - pEqn.flux(); } } // #include "continuityErrs.H" U = HbyA - rAU*(fvc::grad(p)); U.correctBoundaryConditions(); } } ##createFiedls.H volVectorField Gravity2 ( IOobject ( "Gravity2", runTime.constant(), mesh, IOobject::NO_READ, IOobject::NO_WRITE, false ), mesh, dimensionedVector("Gravity2", dimensionSet(0,1,-2,0,0,0,0),vector(0,-9.81,0)) ); |
|
Tags |
channel flows, gravity force, source term |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Boundary condition setting for adding gravity in simpleFoam | norkistar | OpenFOAM Programming & Development | 3 | June 15, 2022 05:20 |
Adding an energy source term to a phase with reactions | lxlxlxt | Fluent Multiphase | 0 | February 10, 2014 21:42 |
Gravity source term in PisoFoam | DanM | OpenFOAM Running, Solving & CFD | 4 | May 24, 2013 12:30 |
Gravity source term in PisoFoam | DanM | Main CFD Forum | 0 | November 28, 2012 13:59 |
ATTENTION! Reliability problems in CFX 5.7 | Joseph | CFX | 14 | April 20, 2010 16:45 |