
[Sponsors] 
what is the role of solve(UEqn == fvc::grad(p));" in icoFoam pisoFoam and ... 

LinkBack  Thread Tools  Display Modes 
January 9, 2012, 07:31 
what is the role of solve(UEqn == fvc::grad(p));" in icoFoam pisoFoam and ...

#1 
Senior Member
Join Date: Jun 2011
Posts: 151
Rep Power: 8 
Sponsored Links
I could not found the role of term "solve(UEqn == fvc::grad(p));" in icoFoam pisoFoam and ... when I have deactivated this term (insert // befor it) the answer did not changed. it is worthwhile to notice that if this term calculate algebraic equation for U and find the new U but this new U is not used in the following of the program and term U = rAU*UEqn.H(); replaced the new value in variable U Best Regards Yasser 

Sponsored Links 
January 10, 2012, 06:58 

#2 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 11 
Hi
Are you sure you complied the solver after the commenting, correctly, and did not use converged data as initial data? 

January 10, 2012, 16:02 

#3  
Senior Member
Join Date: Jun 2011
Posts: 151
Rep Power: 8 
Quote:
Hi ata yes, I placed a copy of icoFoam to my FOAM_USER_APPBIN and replaced icoFoam to icoFoamMod in directory name, .C file and in Make/files then run the wclean then I comment the // solve(UEqn == fvc::grad(p)); at the end I run wmake and successfully compile icoFoamMod then Run cavity tutorial using icoFoamMod But the solution is the same for icoFoam 

January 10, 2012, 16:10 

#4  
Senior Member
Join Date: Jun 2011
Posts: 151
Rep Power: 8 
Quote:
Hi ata yes, I placed a copy of icoFoam to my FOAM_USER_APPBIN and replaced icoFoam to icoFoamMod in directory name, .C file and in Make/files then run the wclean then I comment the // solve(UEqn == fvc::grad(p)); at the end I run wmake and successfully compile icoFoamMod then Run cavity tutorial using icoFoamMod But the solution is the same for icoFoam 

January 10, 2012, 17:09 

#5  
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 14 
Quote:


January 11, 2012, 08:15 

#6 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 11 
Hi
Bernhard is right. 

January 13, 2012, 17:28 

#7  
Senior Member
Join Date: Jun 2011
Posts: 151
Rep Power: 8 
Quote:
Hi Dear Bernhard I check the UEqn.H() and UEqn.A() before and after the solve(UEqn == fvc::grad(p)); the H is changed but A is not changed. if A and H are functions of U why A is not changed ? also can you tell me what functions , terms and matrices are create during bellow terms ? fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U)  fvm::laplacian(nu, U) best regards 

January 14, 2012, 02:41 

#8 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 11 
Hi
As you know U.A() is the matrix of coefficient and it changes if phi or nu changes or you use a different scheme for temporal discretization. Good luck 

January 15, 2012, 18:58 
Algorithm

#9 
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 11 
Dear Foamers,
I would like to know which algorithm the following code represents. Is it PISO or SIMPLE algorithm. Kindly let me know and also the reason for the same. for (int corr = 0; corr < nCorr; corr++) { tmp<fvVectorMatrix> UEqn ( fvm::ddt(U) + fvm::div(phi, U)  fvm::laplacian(nu, U) ); UEqn().relax(); eqnResidualU = solve ( UEqn() == fvc::grad(p) ).initialResidual(); maxResidual_U = max(eqnResidualU, maxResidual_U); p.boundaryField().updateCoeffs(); volScalarField rUA = 1.0/UEqn().A(); U = rUA*UEqn().H(); UEqn.clear(); phi = fvc::interpolate(U) & mesh.Sf(); adjustPhi(phi, U, p); p.storePrevIter(); // Nonorthogonal pressure corrector loop for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( fvm::laplacian(rUA, p) == fvc::div(phi) ); pEqn.setReference(pRefCell, pRefValue); pEqn.solve(); if (nonOrth == nNonOrthCorr) { phi = pEqn.flux(); } } p.relax(); U = rUA*fvc::grad(p); U.correctBoundaryConditions(); Info << eqnResidualU << endl; } Thanks Regards Vishal 

January 17, 2012, 02:15 

#10  
Senior Member
Join Date: Jun 2011
Posts: 151
Rep Power: 8 
Quote:
this is the SIMPLE algorithm because it has only one pressure correction during each time step 

January 17, 2012, 13:05 

#11 
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 11 
Thanks for the reply. In that case I have two queries.
1. SIMPLE algorithm can be used to solve unsteady problems right !! 2. I couldn't understand regarding one pressure correction during each time step you had mentioned. As I saw the PISO algorithm in icoFoam and found almost the same code, except the momentum equation is solved before the " for (int corr=0; corr<nCorr; corr++) loop" Could you clarify what exactly is happening in these algorithms as I couldnt follow from the wikilinks provided to explain these algoritms. Thanks Regards Vishal Nandigana 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
pimpleFoam vs simpleFoam vs pisoFoam vs icoFoam?  phsieh2005  OpenFOAM Running, Solving & CFD  38  July 7, 2017 01:09 
icoFoam VS pisoFoamLaminar  M3hdi  OpenFOAM Running, Solving & CFD  16  May 17, 2013 12:34 
pisoFoam compiling error with OF 1.7.1 on MAC OSX  Greg Givogue  OpenFOAM Programming & Development  3  March 4, 2011 18:18 
Kubuntu uses dash breaks All scripts in tutorials  platopus  OpenFOAM Bugs  8  April 15, 2008 07:52 
Sponsored Links 