CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Implicit vs Explicit

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 2 Post By Houthuys
  • 1 Post By FMDenaro
  • 1 Post By Houthuys
  • 2 Post By sbaffini
  • 1 Post By Houthuys
  • 1 Post By HectorRedal

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 29, 2017, 01:52
Default Implicit vs Explicit
  #1
New Member
 
rik houthuys
Join Date: Jan 2017
Posts: 27
Rep Power: 9
Houthuys is on a distinguished road
Hello every one,

My understanding of the difference between implicit and explicit methods is that (correct me if I'm wrong):

In the explicit methods we use: d(Φ)/dt = F(Φ_n-1), where F(Φ_n-1) represents the spatial derivatives evaluated using the value of Φ in the previous time step which is known. This leads to an explicit formula to calculate Φ in the current time step.

In the implicit methods we use: d(Φ)/dt = F(Φ_n), where F(Φ_n) represents the spatial derivatives evaluated using the value of Φ in the the current time step which is unknown. This leads to a system of equations which in the form of [A][Φ]=[b] which can be solved using direct or iterative solver to get the value of Φ in the current time step.

So my question is:
if we evaluate some term in RHS explicitly while other terms are calculated implicitly, i.e.:
d(Φ)/dt = g(Φ_n-1)+h(Φ_n). While solving this equation iteratively should we use the value from the previous time step or the previous iteration to evaluate g(Φ_n-1)?
Quasar_89 and granzer like this.
Houthuys is offline   Reply With Quote

Old   January 29, 2017, 04:45
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I am not sure about what you would perform....
I try to give you a general suggestion. Consider the continuous differential equation, valid for any time t.

dΦ/dt = F(Φ)

Now integrate between tn and tn+1

Φ(tn+1) - Φ(tn) = Int[tn,tn+1] F(Φ) dt

That result is exact, no discretization being introduced.

Now you can consider:

explicit: the RHS is discretized using only value at tn (or previous values for multi-step method)

fully implicit: the RHS is discretized using only value at tn+1

implicit: the RHS is discretized using values both at tn and tn+1
granzer likes this.
FMDenaro is offline   Reply With Quote

Old   January 29, 2017, 05:48
Default
  #3
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by Houthuys View Post
Hello every one,

My understanding of the difference between implicit and explicit methods is that (correct me if I'm wrong):

In the explicit methods we use: d(Φ)/dt = F(Φ_n-1), where F(Φ_n-1) represents the spatial derivatives evaluated using the value of Φ in the previous time step which is known. This leads to an explicit formula to calculate Φ in the current time step.

In the implicit methods we use: d(Φ)/dt = F(Φ_n), where F(Φ_n) represents the spatial derivatives evaluated using the value of Φ in the the current time step which is unknown. This leads to a system of equations which in the form of [A][Φ]=[b] which can be solved using direct or iterative solver to get the value of Φ in the current time step.

So my question is:
if we evaluate some term in RHS explicitly while other terms are calculated implicitly, i.e.:
d(Φ)/dt = g(Φ_n-1)+h(Φ_n). While solving this equation iteratively should we use the value from the previous time step or the previous iteration to evaluate g(Φ_n-1)?
If I got correctly what you meant, the main difference between the two approaches you are considering stems from the original nature of your equation.

If it is linear then there is no actual point to evaluate g at the previous time step or iteration. The only cases where you would do that are those in which g represents part of some backward time discretization. As you might have got, in this case you consider the previous time step, not the previous iteration.

For non linear equations you may have the same unsteady terms of the linear case, and the same as above applies. But you may also have terms which you can't just write exactly at the next time, because of the nonlinearity.

Nonlinearity is typically solved by adding outer iterations, which are different from the iterations used to solve the system.

In practice they are just needed to update all those non linear terms. You set up and solve your system (with inner linear iterations), update your non linear terms, go to the next outer iterations and solve again, etc. Once you converge in outer iterations you can actually go to the next time step.

To more concretely answer your question, non linear terms are never updated while solving the linear system itself (i.e., during the inner iterations) because it would mea changing the actual system while solving it and no method would work.

In practice, you can achieve something very similar to this by using only 1 inner iteration, which you understand that typically means not actually solving the system, with all its consequences.
sbaffini is offline   Reply With Quote

Old   January 29, 2017, 06:02
Default
  #4
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Note that multigrid, used to solve the inner iterations, might somehow seem to escape this picture, as it is sltypically used with only 1 cycle for non linear problems. In practice, however, each multigrid cycle involves solving several linear systems with different matrices so, in practice, you are still solving the inner linear system with more than 1 iteration.
sbaffini is offline   Reply With Quote

Old   January 29, 2017, 06:37
Default
  #5
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I still have doubt about the original question... it seems that the example of the Crank-Nicholson (diffusion) and Adams-Bashfort (convection) should be the best fit to the issue, isn't it?
FMDenaro is offline   Reply With Quote

Old   January 29, 2017, 07:46
Default
  #6
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by FMDenaro View Post
I still have doubt about the original question... it seems that the example of the Crank-Nicholson (diffusion) and Adams-Bashfort (convection) should be the best fit to the issue, isn't it?
Now that i read again the question, i might have gone too far.

I guess then that the answer is even more simple: if n is the time level, than that's it, it can't change with the linear system iterations, for which an additional iteration counter should be added for clarity, say, k.
sbaffini is offline   Reply With Quote

Old   January 29, 2017, 11:49
Default
  #7
New Member
 
ryariyaz's Avatar
 
Join Date: Dec 2016
Posts: 14
Rep Power: 9
ryariyaz is on a distinguished road
Simple difference is modelling unknow terms with help of know quantities is called implicit . Modelling unknown interms of another unknown is explicit

Sent from my HTC Desire 526GPLUS dual sim using CFD Online Forum mobile app
ryariyaz is offline   Reply With Quote

Old   January 29, 2017, 14:16
Default
  #8
New Member
 
rik houthuys
Join Date: Jan 2017
Posts: 27
Rep Power: 9
Houthuys is on a distinguished road
Thanks for you all for this enlightening reply and sorry if I made confusion. I, myself, confused.

To make it more clear I will give an example of what I'm asking about.

Consider solving the incompressible NSE. Usually this is done using a pressure-velocity decoupling algorithm, e.g. SIMPLE algorithm. In this algorithm the Momentum equation is solved first (momentum predictor) to obtain velocity field that satisfy the momentum equation but not the continuity equation. To solve this nonlinear equation we evaluate both pressure and face flux explicitly using values from previous iteration or initial guess. Then the pressure correction equation is solved to satisfy the continuity constrain. Then the velocity and pressure is corrected and we start over again.

So in the momentum equation some terms (velocity components) are treated implicitly (as unknown) while other terms (pressure and face flux) are treated explicitly (as known). So, I just wondering, is it precise to call this solution implicit solution or not because some terms are evaluated in explicit way? Or this is totally different discussion.
granzer likes this.
Houthuys is offline   Reply With Quote

Old   January 29, 2017, 14:27
Default
  #9
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
well, you should differentiate the implicit time scheme from the coupling in a system of PDE....
the terms implicit integration is just valid for a single PDE equation discretized in such a way that the algebric form is A. f_n+1= f_n.
FMDenaro is offline   Reply With Quote

Old   January 30, 2017, 04:16
Default
  #10
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by Houthuys View Post
So in the momentum equation some terms (velocity components) are treated implicitly (as unknown) while other terms (pressure and face flux) are treated explicitly (as known). So, I just wondering, is it precise to call this solution implicit solution or not because some terms are evaluated in explicit way? Or this is totally different discussion.
Well, this is a totally different matter. This only concerns the coupling among equations. There are several possibilities which go beyond the one cited by you (which, for example, is the default one in OF). As you can imagine, the coupling is fully implicit only if the equations are solved in a coupled fashion (1 larger system with momentum and pressure equations put together with the relative mixed coefficients in the matrix). Otherwise, it is explicit. SIMPLE actually stands for Semi-Implicit Method for Pressure-Linked Equations.
sbaffini is offline   Reply With Quote

Old   January 31, 2017, 17:17
Default
  #11
Senior Member
 
Hector Redal
Join Date: Aug 2010
Location: Madrid, Spain
Posts: 243
Rep Power: 17
HectorRedal is on a distinguished road
Hi,

Is there any reference / book that explains what is the different between explicit / implicit and innter itteration vs outer itterations?

I have Anderson's Book and Fletger's book.
Is it explained in this references?

BR
HectorRedal is offline   Reply With Quote

Old   January 31, 2017, 17:30
Default
  #12
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by HectorRedal View Post
Hi,

Is there any reference / book that explains what is the different between explicit / implicit and innter itteration vs outer itterations?

I have Anderson's Book and Fletger's book.
Is it explained in this references?

BR

give also a look to Chap. 6 and 7 of the book of Peric & Ferziger
FMDenaro is offline   Reply With Quote

Old   February 1, 2017, 03:46
Default
  #13
Senior Member
 
Hector Redal
Join Date: Aug 2010
Location: Madrid, Spain
Posts: 243
Rep Power: 17
HectorRedal is on a distinguished road
I have not access to Ferziger's book.
I will look for the information in the Fletcher's book. I have taken a look at the Anderson's book, but the information appearing is reduced (not much more elaborated).
HectorRedal is offline   Reply With Quote

Old   February 1, 2017, 08:04
Default
  #14
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by HectorRedal View Post
Hi,

Is there any reference / book that explains what is the different between explicit / implicit and innter itteration vs outer itterations?

I have Anderson's Book and Fletger's book.
Is it explained in this references?

BR
I have none of the two, and i have never read them (for what matters). However, the matter is pretty simple. Consider the following code snippet taken from OF (there are several, but most of them employ exhotic approaches, this instead is pretty clear about the matter):

http://www.openfoam.com/documentatio...8C_source.html

In particular, just watch the lines 97-130.

The outermost loop is in time. You have this only for unsteady problems.

The next loop (lines 108-123) represents the so called "outer iterations". They handle non linearity, higher order discretizations (typically, for unstructured grids) and/or coupling among the equations.

Inner iterations refers instead to the iterations used to solve a linear system of equations, assuming of course that you are using some sort of iterative method to solve them, say, gauss-seidel.

If you look in the two files peqn.H and ueqn.H, they both assemble a specific linear system and solve it by inner iterations. Consider, for example, the pressure (file peqn.H, http://www.openfoam.com/documentatio...8H_source.html). At the lines 36-39 the system of equations for the pressure is assembled; at the line 43 it is solved. You don't actually see here the inner iterations because they are part of the method used to solve the linear system; they are just embedded in the command of line 43. Similar arguments also hold for the momentum equations (in UEqn.H).

For what concerns the coupling, in this case you have a segregated approach: the momentum (UEqn) is first advanced with the old (in terms of outer iterations) pressure, then the pressure is solved (pEqn) by using the new velocity field, and over and over again until convergence in outer iterations. You can notice this in the matrix assembly lines (e.g., lines 36-39 for the pressure): implicit terms are those with fvm, explicit ones (i.e., using last available values) are those with fvc.

Nonlinearity is here all embedded in the term phi, the mass flux, computed after the pressure equation, and kept frozen in the momentum equation.

The handling of high-order discretizations in this framework is difficult to explain to a novice. It is based on the deferred correction approach. Just get to it when you have a clearer picture.

One thing to highlight here is that nothing is ever updated between inner iterations. Just as nothing could be updated if a direct resolution method was used instead of an iterative one.
HectorRedal and Houthuys like this.
sbaffini is offline   Reply With Quote

Old   February 2, 2017, 17:07
Default
  #15
New Member
 
rik houthuys
Join Date: Jan 2017
Posts: 27
Rep Power: 9
Houthuys is on a distinguished road
Dear Paolo, Thank you so much.
sbaffini likes this.
Houthuys is offline   Reply With Quote

Old   February 3, 2017, 12:17
Default
  #16
Senior Member
 
Hector Redal
Join Date: Aug 2010
Location: Madrid, Spain
Posts: 243
Rep Power: 17
HectorRedal is on a distinguished road
Hi Paolo,

Thanks for your response.
I think I have grasped a good picture of explicity and implicit techniques.

Best regards,
Hector.
sbaffini likes this.
HectorRedal 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
wallFilm-solver: explicit or implicit? fsch1 OpenFOAM Running, Solving & CFD 0 December 19, 2016 05:05
Newbie question about explicit and implicit methods Yuby Main CFD Forum 10 May 29, 2015 14:16
Explicit vs Implicit VOF in Fluent MachZero FLUENT 5 August 7, 2013 19:17
Euler (explicit or implicit) anybody Main CFD Forum 2 May 8, 2006 03:12
implicit vs explicit pXYZ Main CFD Forum 2 April 21, 2006 10:48


All times are GMT -4. The time now is 09:27.