CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Local residuals

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 4, 2008, 05:34
Default Hi everybody, is it possibl
  #1
New Member
 
Christian Egerer
Join Date: Mar 2009
Posts: 8
Rep Power: 9
chrisegerer is on a distinguished road
Hi everybody,

is it possible to display local residuals in OpenFOAM?
I'm asking because I would like to see where the pressure solver has its problems.

Thanks, Christian
chrisegerer is offline   Reply With Quote

Old   June 4, 2008, 08:35
Default A while back I wrote a simpleF
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,781
Rep Power: 22
hjasak will become famous soon enough
A while back I wrote a simpleFoamResidual application a while back - this will calculate and write a residual field for a simpleFoam run. Is this what you are after or do you need only the pressure residual?

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   June 5, 2008, 01:37
Default As long as the pressure residu
  #3
New Member
 
Christian Egerer
Join Date: Mar 2009
Posts: 8
Rep Power: 9
chrisegerer is on a distinguished road
As long as the pressure residual is included, I will be happy with it.

Is it included in OpenFOAM 1.4.1, because I haven't found it yet. Would it be possible (difficult) to adapt the code to run with turbFoam, too?

Thanks for the quick reply.
Christian
chrisegerer is offline   Reply With Quote

Old   June 5, 2008, 02:18
Default This is a tricky question. If
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,781
Rep Power: 22
hjasak will become famous soon enough
This is a tricky question. If you want "pure" pressure residual, plot fvc::div(phi) and we are done. In fact, it will tell you very little...

For the momentum residual, you can find the code in:

http://openfoam-extend.svn.sourceforge.net/viewvc/openfoam-extend/trunk/Core/Ope nFOAM-1.4.1-dev/applications/utilities/errorEstimation/simpleFoamResidual/

and no changes are needed. If you wish to run it with the ddt term, this should be added into simpleFoamResidual, BUT you also need to write U_0 for every time-step during your simulation. If you just forget it, the residual picture will be (very slightly) polluted by ddt(U) - which tends to be small.

Please keep me posted,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   June 6, 2008, 03:15
Default In fact I don't really know if
  #5
New Member
 
Christian Egerer
Join Date: Mar 2009
Posts: 8
Rep Power: 9
chrisegerer is on a distinguished road
In fact I don't really know if I want "pure" pressure residuals. I just want a measure where I can find the bad parts of my mesh. If the momentum residual can tell me that I will use it.

Is the momentum residual comparable to the features you can use, for example, in CFX to display local residuals?

So, if I have the expert at hand, I have to ask a few more questions:

I'm struggling now for approx. 2 month to figure out how to get done the simulations I want to do for the flow around the ahmed car at 25deg (other angles should follow). I started with a tetra-mesh but have now switched to a hexa-mesh, both were generated with ICEM. According to the quality measures in ICEM(determinant, angle, skew, overall quality) the hexa one should be a quite good mesh. The boundary layers are highly resolved because I want to use a turbulence model without wall functions (LaunderSharma, LienCubicKELowRe) to get an accurate separation point.
CheckMesh returns warnings for short edges and high aspect ratio cells.
I'm using turbFoam.
All solvers for the pressure I tried (PCG with DIC, GAMG) need approx. the same number of iterations for each pressure correction loop, regardless of the discretisation schemes used.
For initialization I used a solution obtained with potentialFoam. Here what makes me a little bit thought-proviking is, that at the edges at the back of the car unusual high velocities up to 200m/s occur.
My boundary conditions:
Inlet: fixedValue for U, k, epsilon; zeroGradient for pressure.
Outlet: fixedValue for p; zero Gradient for U, k, epsilon.
Ahmed body (wall): fixedValue for U (0 0 0), k (10e-10); zeroGradient for epsilon, p. Same for the floor to compare the setup with wind tunnel tests.
Bounding Walls: slip for U, zeroGradient for p, k, epsilon.

So, after this "short" outline of the problems I encountered so far, now the questions:

(1) Can short edges and high aspect ratios be the reason for getting bad convergence with the pressure solver? These short edges and high aspect ratio cells are due to the highly resolved boundary layer around the ahmed body and floor and a comparatively rather coarse resolution in the other two directions, I think? Similar simulations were done with CFX on a slightly different hybrid mesh but also with a highly resolved boundary layer and this made no problems.

(2) Can this bad initial solution from potentialFoam spoil the rest of the solution?

(3) Are the boundary conditions usable?

I would be glad if you could give me some hints or could point me in the right direction to resolve these problems.

Thanks in advance,
Christian
chrisegerer is offline   Reply With Quote

Old   September 29, 2010, 13:37
Default
  #6
Member
 
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 9
nikwin is on a distinguished road
Hello,

I would like to calculate the residual for the spatial terms of the momentum eq. in the rhoPisoFoam solver. However as a test I included the transient term to see that the momentum equation is fulfilled, which it is not, even though the initial residuals during computations are small for U. I tried to perform my computations explicitly as in the code given in the thread above,

volScalarField uResidual1
(
mag
(
fvc::ddt(rho, U)
+ fvc::div(phi, U)
+ fvc::div(turbulence->devRhoReff())
+ fvc::grad(p)
)
);

Info<< "uResidual1 max: " << max(uResidual1.internalField())
<< " mean: "
<< sum(uResidual1.internalField()*mesh.V())/sum(mesh.V()).value()
<< endl;

Results: uResidual1 max: 11795617.43 mean: 93960.83833

1) Any suggestion to what could be wrong when computing the residual as above?

2) Is there a way to compute the viscous term exactly as in rhoPisoFoam, i.e. using turbulence->divDevRhoReff(U)? (However the viscous terms are small anyway)

3) How are the residuals for the fvMatrix calculated? (I don't understand the code in IduMatrix.C)

Thanks
/NW
nikwin is offline   Reply With Quote

Old   October 4, 2010, 05:57
Default
  #7
Senior Member
 
M. Montero
Join Date: Mar 2009
Location: Madrid
Posts: 121
Rep Power: 9
be_inspired is on a distinguished road
Quote:
Originally Posted by hjasak View Post
A while back I wrote a simpleFoamResidual application a while back - this will calculate and write a residual field for a simpleFoam run. Is this what you are after or do you need only the pressure residual?

Hrv
I hope hjasak will read this message.

Is this application valid for OF 1.6.x or is a modification neccesary?
How I must to run the application?

Thanks
be_inspired is offline   Reply With Quote

Old   November 2, 2010, 12:10
Default
  #8
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 14
maddalena is on a distinguished road
Hi,
Quote:
Originally Posted by be_inspired View Post
Is this application valid for OF 1.6.x or is a modification neccesary?
How I must to run the application?
You must change the turbulence definition on the posted file in order to match the new OF 1.6 definition. You can have an idea comparing the files as above to the simpleFoam solver files in OF 1.6. The correction is straight away.

mad
maddalena is offline   Reply With Quote

Old   January 12, 2011, 05:29
Default
  #9
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 214
Rep Power: 11
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
Hi all!

Is it possible to get initialResidual values without actually solving the linear equations system? The problem arises, because solverPerformance data is created by the lduMatrix/fvMatrix solve() method. Is there any mechanism just to get the initial information only, regarding the system to be solved?

Waiting for your response!
Thank you and have a nice day!

Alexander
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Advanced Process Simulation of
Solidification and Melting"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

Franz-Josef-Str. 18
A - 8700 Leoben
Österreich / Austria
Tel.: +43 3842 - 402 - 3125
http://smmp.unileoben.ac.at

Last edited by makaveli_lcf; January 13, 2011 at 04:06.
makaveli_lcf is offline   Reply With Quote

Old   March 8, 2011, 06:25
Default
  #10
Member
 
Vishal Jambhekar
Join Date: Mar 2009
Location: University Stuttgart, Stuttgart Germany
Posts: 90
Blog Entries: 1
Rep Power: 9
vishal is on a distinguished road
Hi All,

I am also trying to do flow simulation for a city model. And using Simplefoam form the same. I am also facing similer kind of issues as MALLALENA

please rever to following post for case details.

http://http://www.cfd-online.com/For...urbulence.html

I was thinking it is due to inlet conditions but I found out that the pressure solwing is getting blown up after few iterations.

I am using tetrahedral mesh.

Thanks a lot for ur kind help
__________________
Cheers,

Vishal Jambhekar...
"Simulate the way ahead......!!!"
__________________
Cheers,

Vishal Jambhekar...
"Simulate the way ahead......!!!"
vishal is offline   Reply With Quote

Old   March 8, 2011, 06:26
Default
  #11
Member
 
Vishal Jambhekar
Join Date: Mar 2009
Location: University Stuttgart, Stuttgart Germany
Posts: 90
Blog Entries: 1
Rep Power: 9
vishal is on a distinguished road
Hi All,

I am also trying to do flow simulation for a city model. And using Simplefoam form the same. I am also facing similer kind of issues as MALLALENA

please rever to following post for case details.

http://http://www.cfd-online.com/For...urbulence.html

I was thinking it is due to inlet conditions but I found out that the pressure solwing is getting blown up after few iterations.

I am using tetrahedral mesh.

Thanks a lot for ur kind help..
__________________
Cheers,

Vishal Jambhekar...
"Simulate the way ahead......!!!"
vishal is offline   Reply With Quote

Old   May 19, 2011, 09:01
Default
  #12
Senior Member
 
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 165
Rep Power: 8
Anne Lincke is on a distinguished road
Quote:
Originally Posted by be_inspired View Post
I hope hjasak will read this message.

Is this application valid for OF 1.6.x or is a modification neccesary?
How I must to run the application?

Thanks
If you still face those problems this discussion might be helpful:

Residual Field OpenFOAM

Can anyone tell me if the equation

fvc::div(phi, U) + fvc::div(turbulence->R()) + fvc::grad(p)
which is used in the routine simpleFoamResiduals.C is the same as the momentum equation in simpleFoam.C which reads:

fvm::div(phi, U) + turbulence->divDevReff(U) + fvc::grad(p)

?
Thank you for your answer in advance.
Anne Lincke is offline   Reply With Quote

Old   October 10, 2013, 05:29
Default
  #13
Senior Member
 
M. Montero
Join Date: Mar 2009
Location: Madrid
Posts: 121
Rep Power: 9
be_inspired is on a distinguished road
I am still interested in this topic. Is It the same?

How can I interpretate the uResidual field? 2000 is a high number? Is there a physical meaning for that figure?
be_inspired is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFoam local and local sven82 OpenFOAM Installation 1 December 9, 2008 10:40
local age of air in starccm+ Mike23 CD-adapco 3 September 20, 2008 11:16
Local refinement anita Open Source Meshers: Gmsh, Netgen, CGNS, ... 0 March 28, 2008 08:32
sum local stephan OpenFOAM Running, Solving & CFD 1 July 24, 2007 10:41
Is FEM Local Conservative R.A.Khurram Main CFD Forum 9 July 2, 2003 02:47


All times are GMT -4. The time now is 15:45.