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

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

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Bernhard
  • 1 Post By mechy

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 9, 2012, 07:31
Default what is the role of solve(UEqn == -fvc::grad(p));" in icoFoam pisoFoam and ...
  #1
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
Hello All
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
mechy is offline   Reply With Quote

Old   January 10, 2012, 06:58
Default
  #2
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18
ata is on a distinguished road
Hi
Are you sure you complied the solver after the commenting, correctly, and did not use converged data as initial data?
ata is offline   Reply With Quote

Old   January 10, 2012, 16:02
Default
  #3
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
Quote:
Originally Posted by ata View Post
Hi
Are you sure you complied the solver after the commenting, correctly, and did not use converged data as initial data?


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
mechy is offline   Reply With Quote

Old   January 10, 2012, 16:10
Default
  #4
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
Quote:
Originally Posted by ata View Post
Hi
Are you sure you complied the solver after the commenting, correctly, and did not use converged data as initial data?


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
mechy is offline   Reply With Quote

Old   January 10, 2012, 17:09
Default
  #5
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
Quote:
Originally Posted by mechy View Post
Hello All
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
If you look closely to the pisoFoam solver, you will see that this term is only executed when the momentumPredictor flag is set to true. Please have a look at Hrvoje Jasaks thesis in paragraph 3.8 where most of this is explained. Does ignoring this line have an effect on the convergence rate (check your log files)
sharonyue likes this.
Bernhard is offline   Reply With Quote

Old   January 11, 2012, 08:15
Default
  #6
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18
ata is on a distinguished road
Hi
Bernhard is right.
ata is offline   Reply With Quote

Old   January 13, 2012, 17:28
Default
  #7
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
Quote:
Originally Posted by Bernhard View Post
If you look closely to the pisoFoam solver, you will see that this term is only executed when the momentumPredictor flag is set to true. Please have a look at Hrvoje Jasaks thesis in paragraph 3.8 where most of this is explained. Does ignoring this line have an effect on the convergence rate (check your log files)

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
babala likes this.
mechy is offline   Reply With Quote

Old   January 14, 2012, 02:41
Default
  #8
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18
ata is on a distinguished road
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
ata is offline   Reply With Quote

Old   January 15, 2012, 18:58
Default Algorithm
  #9
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18
nandiganavishal is on a distinguished road
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();

// Non-orthogonal 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
nandiganavishal is offline   Reply With Quote

Old   January 17, 2012, 02:15
Default
  #10
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
Quote:
Originally Posted by nandiganavishal View Post
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();

// Non-orthogonal 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

this is the SIMPLE algorithm because it has only one pressure correction during each time step
mechy is offline   Reply With Quote

Old   January 17, 2012, 13:05
Default
  #11
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18
nandiganavishal is on a distinguished road
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
nandiganavishal 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
icoFoam VS pisoFoam-Laminar M3hdi OpenFOAM Running, Solving & CFD 17 May 21, 2022 01:55
pimpleFoam vs simpleFoam vs pisoFoam vs icoFoam? phsieh2005 OpenFOAM Running, Solving & CFD 45 March 22, 2021 10:14
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 08:52


All times are GMT -4. The time now is 17:55.