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

laplacianFoam: problem with fvc::laplacian

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 1, 2016, 13:20
Default laplacianFoam: problem with fvc::laplacian
  #1
Member
 
Vincent Leroy
Join Date: Jul 2012
Location: Rhode-Saint-Genèse, Belgium
Posts: 43
Rep Power: 14
leroyv is on a distinguished road
Dear OpenFOAM users,

I am developing a solver for a 1D application. I started with laplacianFoam as a base, and at some point, I had to introduce a source term which is a combination of laplacian(DT, T) in some cells and and some other computations in the others (impossible to use partitioning into regions because the cells concerned by the special computations change dynamically).

Since I could not mix implicit and explicit terms, I decided to go fully explicit and used fvc::laplacian(DT, T). This resulted in a crash of the solver. On the forum, I saw that people having that problem usually have it solved by simply changing the numerical scheme; however, in the case of that 1D example, it does not seem to make a difference.

I investigated using a minimal working example attached to this post. It is made of:
  • a test solver, which is simply laplacianFoam
  • a test case, 1D uniform temperature initial condition and a temperature ramp BC using groovyBC
A strange thing is that if I leave the laplacian implicit and output fvc::laplacian(DT,T), no weird things happen.

Question: Does someone have an idea of what is happening?

PS: In case that would be of any help, I should also mention that in the practical example I am dealing with (not the MWE), the source term wiggles very oddly and explodes when going in the direction of the "hot" wall. I attached a screenshot of postprocessed data: in blue is the initial source term (non-zero, but small intensity compared to the green curve) and in green is the source term after the first time step.
Attached Images
File Type: jpg source_term.jpg (86.7 KB, 35 views)
Attached Files
File Type: zip laplacian_mwe.zip (12.4 KB, 13 views)
leroyv is offline   Reply With Quote

Old   September 2, 2016, 04:03
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Dear Vincent,

first of all, thank you for investigating into your first post and providing all the necessary information that we need to help you. There is only one information missing (the version of FOAM you are using but I guess it is 2.3.1). It is very seldom that we got these informations within the first post.

Cause of your problem
I checked your solver and especially your domain. I hope you know the differences between explicit and implicit. The problem you are solving is a parabolic problem and here you have a strict criteria that has to be fulfilled. It is the Fourier Number. If you have 1D problems and you solve just the laplace equation with an explicit scheme, you are limited to Fo = 0.5.


Fo = \frac{D  \delta t}{\delta x^2}

and hence

\delta t  = \frac{Fo \delta x^2}{D} = \frac{0.5 \cdot 0.0000581^2}{0.1} = 0.00000001687805

Or if we check the Fourier Number we would get with your settings:

Fo = \frac{0.1  \cdot 0.001}{0.0000581^2} = 29624

The residual demonstrate this too. Hence, you know why explicit is always a bad choice. If you reduce your time step below 1e-7 your solver works based on the theory above. That's all.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   September 2, 2016, 08:34
Default
  #3
Member
 
Vincent Leroy
Join Date: Jul 2012
Location: Rhode-Saint-Genèse, Belgium
Posts: 43
Rep Power: 14
leroyv is on a distinguished road
Hi Tobias,

Thank you very much for this thorough answer. Sometimes, I get lost in the complicated stuff and even forget about the most elementary things.

Coming back to my original problem: my conservation equation is
\frac{\partial T}{\partial t} = D \Delta T + S
where S = D' \Delta T in some regions and is gotten from another solver elsewhere. How come the laplacian part of S affects the stability of the problem? Does this mean that not satisfying the stability criterion results in practice in (very) wrong values of the explicitly evaluated laplacian operator?
leroyv is offline   Reply With Quote

Reply

Tags
explicit, laplacian operator


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
[Other] engineFoam new mesh problem ayhan515 OpenFOAM Meshing & Mesh Conversion 5 August 10, 2015 09:45
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 05:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 06:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 07:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 20:13


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