# Laplace, Grad, snGrad of T

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
September 14, 2012, 04:52
Laplace, Grad, snGrad of T
#1
Member

Join Date: May 2012
Location: Dresden, Germany
Posts: 32
Rep Power: 5
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?

 September 17, 2012, 08:43 #2 Member   Join Date: May 2012 Location: Dresden, Germany Posts: 32 Rep Power: 5 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.

 September 17, 2012, 09:13 #3 Senior Member     Philip Cardiff Join Date: Mar 2009 Location: Dublin,Ireland Posts: 568 Rep Power: 19 Hi, are the grad/laplacian fields non-zero everywhere in your domain or only in certain places (skewed cells, boundary cells, …)? Philip

September 17, 2012, 10:00
#4
Member

Join Date: May 2012
Location: Dresden, Germany
Posts: 32
Rep Power: 5
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)

 September 17, 2012, 10:13 #5 Senior Member     Philip Cardiff Join Date: Mar 2009 Location: Dublin,Ireland Posts: 568 Rep Power: 19 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

September 17, 2012, 10:34
#6
Member

Join Date: May 2012
Location: Dresden, Germany
Posts: 32
Rep Power: 5
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
 wuerfel.jpg (24.3 KB, 28 views)

September 17, 2012, 10:50
#7
Senior Member

Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 568
Rep Power: 19
Quote:
 Originally Posted by dl6tud 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

 September 18, 2012, 07:13 #8 Member   Join Date: May 2012 Location: Dresden, Germany Posts: 32 Rep Power: 5 Thank you! When using a 0-temperature field, gradient and laplace are zero, too. It is not perfect yet, but acceptable.

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post Benedikt OpenFOAM Pre-Processing 1 June 25, 2012 08:54 doubtsincfd OpenFOAM 0 December 19, 2011 19:19 Ingenierias2003 OpenFOAM 0 July 21, 2011 09:29 cfdmarkus OpenFOAM Bugs 2 July 16, 2009 18:54 walli Main CFD Forum 0 May 4, 2009 09:42

All times are GMT -4. The time now is 00:10.

 Contact Us - CFD Online - Top