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

Laplace, Grad, snGrad of T

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 14, 2012, 05:52
Default Laplace, Grad, snGrad of T
  #1
Member
 
Norbert Weber
Join Date: May 2012
Location: Dresden, Germany
Posts: 37
Rep Power: 14
dl6tud is on a distinguished road
I have a constant Temperature field with T=300:

Quote:
internalField uniform 300;

boundaryField
{
floor
{
type fixedValue;
value uniform 300;
}
ceiling
{
type fixedValue;
value uniform 300;
}
fixedWalls
{
type fixedValue;
value uniform 300;
}
}
I try the following:
fvc::snGrad(T) = 0
fvc::grad(T) != 0
fvc::laplacian(constant,T) != 0

Having a constant Temperture field, I assume, that the gradient is zero. But in OF it is not zero!!! Using a vectorField (like U with Ux,Uy,Uz) the gradient is 0, that is ok.

The problem occurs when solving a temperature equation, where the laplacian is calculated. If the laplacian of a constant temperature field is not zero, I get wrong results.

Can anyone help?
dl6tud is offline   Reply With Quote

Old   September 17, 2012, 09:43
Default
  #2
Member
 
Norbert Weber
Join Date: May 2012
Location: Dresden, Germany
Posts: 37
Rep Power: 14
dl6tud is on a distinguished road
I tried different numerical schemes for grad and laplacian:

grad(T)
- Gauss linear: not correct
- leastSquares: ok
- fourth: ok

snGrad(T)
- corrected: ok
- uncorrected: ok

laplacian(x,T)
- Gauss xxxxxxx, uncorrected: not correct

It seems, there is a problem with Gaussian differencing schemes. When I use them on a constant field, I get grad/laplacian which is not zero.
dl6tud is offline   Reply With Quote

Old   September 17, 2012, 10:13
Default
  #3
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Hi,

are the grad/laplacian fields non-zero everywhere in your domain or only in certain places (skewed cells, boundary cells, …)?

Philip
bigphil is offline   Reply With Quote

Old   September 17, 2012, 11:00
Default
  #4
Member
 
Norbert Weber
Join Date: May 2012
Location: Dresden, Germany
Posts: 37
Rep Power: 14
dl6tud is on a distinguished road
Only in certain places:

grad(T)=
Quote:
(2.77556e-14 0 2.77556e-14)
(-2.42861e-14 2.77556e-14 2.77556e-14)
(0 0 0)
(0 5.55112e-14 2.77556e-14)
(0 2.77556e-14 0)
(2.77556e-14 0 2.77556e-14)
(-2.94903e-14 0 -2.77556e-14)
(0 0 0)
(2.94903e-14 -2.77556e-14 0)
(-2.77556e-14 0 -2.77556e-14)
(0 -1.73472e-15 2.77556e-14)
(-6.93889e-15 -3.1225e-14 -2.77556e-14)
(1.73472e-15 -1.73472e-15 -2.77556e-14)
(0 0 0)
(0 -2.77556e-14 0)
dl6tud is offline   Reply With Quote

Old   September 17, 2012, 11:13
Default
  #5
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
OK,

What are the certain places? Are they poor cells or boundary cells? It is very difficult to determine the problem without sufficient information.

The gradients you have given are very very small (less than 1e-13) and as such can be considered zero for most applications as you are approaching the machine tolerance.

Philip
bigphil is offline   Reply With Quote

Old   September 17, 2012, 11:34
Default
  #6
Member
 
Norbert Weber
Join Date: May 2012
Location: Dresden, Germany
Posts: 37
Rep Power: 14
dl6tud is on a distinguished road
Thanks for your answer, Philip!

It seems, that all cells have wrong values (see picture).

You are right, the values are very small, but unfortunately too high for the problem I am working on. These 'invented' temperatures induce a local fluid movement which destroyes my simulation.

Anyway the gradient of a constant temperature fields must be zero.
Attached Images
File Type: jpg wuerfel.jpg (24.3 KB, 58 views)
dl6tud is offline   Reply With Quote

Old   September 17, 2012, 11:50
Default
  #7
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Quote:
Originally Posted by dl6tud View Post
Anyway the gradient of a constant temperature fields must be zero.
Yes mathematically the gradient of a constant field is zero, however, numerical it may not be exactly zero due to the way the computer stores the number.

As a computer can only store to a certain precision for double precision floating point number, then you would expect that the gradient would be zero within this tolerance. I believe the non-zero numbers you are seeing are due to this tolerance.

If your simulations are sensitive to such very small numbers then you should consider using different base units (i.e. MPa instead of Pa, mm instead of m, etc.).

Philip
bigphil is offline   Reply With Quote

Old   September 18, 2012, 08:13
Default
  #8
Member
 
Norbert Weber
Join Date: May 2012
Location: Dresden, Germany
Posts: 37
Rep Power: 14
dl6tud is on a distinguished road
Thank you!
When using a 0-temperature field, gradient and laplace are zero, too. It is not perfect yet, but acceptable.
dl6tud 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
Why define a grad Scheme when using linearUpwind? Benedikt OpenFOAM Pre-Processing 2 August 10, 2019 09:19
gauss grad no correction for coupled boundary??!! doubtsincfd OpenFOAM 0 December 19, 2011 19:19
advanced function with snGrad Ingenierias2003 OpenFOAM 0 July 21, 2011 10:29
Grad evaluation cfdmarkus OpenFOAM Bugs 2 July 16, 2009 19:54
Stokes: Laplace vs. elasticity formulation (P1nc-P0) walli Main CFD Forum 0 May 4, 2009 10:42


All times are GMT -4. The time now is 01:18.