|
[Sponsors] |
January 16, 2014, 22:07 |
Question about gradient scheme
|
#1 |
Member
Tayo
Join Date: Aug 2012
Posts: 94
Rep Power: 13 |
Hello,
I'm puzzled about the way openfoam computes the gradient scheme. I have a temperature field, T that varies between 358 - 400K and I simply take the gradient using fvc::grad(T), with Gauss linear scheme. With a mesh size is approx. 0.3 mm, some of the results for the gradient are printed below: Code:
const volScalarField& T = alpha1_.db().lookupObject<volScalarField>("T"); volVectorField gradT = fvc::grad(T); Info << "gradT =" << gradT << endl; (-164633 -164633 0) (0 -164633 0) (0 -164633 -2.98156e-10) (0 -164633 -2.98156e-10) (0 0 2.98156e-10) (0 0 1.49078e-10) (164633 -164633 0) (0 0 0) (0 0 0) (164633 0 0) (0 0 0) : : : : : : 1.) Why does it print out negative numbers? 2.) How does it get gradient values of (0 0 0) when the T values vary between 358 - 400K. 3.) Why is the z- gradient values so low (2.98156e-10) considering the small mesh size? Kindly help explain what's happening here. Thanks |
|
January 17, 2014, 02:06 |
|
#2 |
Senior Member
|
Quite usual questions:
1. What type of BCs do you use? 2. Can you post checkMesh output? 3. Can you post your fvSchemes? 4. Can you post your case files? |
|
January 17, 2014, 03:58 |
|
#3 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
Post plots of T and gradT from paraview as well.
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
January 18, 2014, 11:57 |
|
#4 |
Member
Tayo
Join Date: Aug 2012
Posts: 94
Rep Power: 13 |
Thanks for the response. Below is my boundary condition
Temp.: fixedGradient on wall, fixedValue inlet, zeroGradient outlet Pressure: zeroGradient inlet and wall, fixedValue outlet Velocity: no slip wall, fixedValue inlet, zeroGradient outlet Here is my fvScheme: Code:
ddtSchemes { default Euler; } gradSchemes { default Gauss linear; } gradSchemes { default Gauss linear; } divSchemes { div(rho*phi,U) Gauss limitedLinearV 1; div(phi,T) Gauss upwind; div(phi,p_rgh) Gauss upwind; div(phi,alpha) Gauss vanLeer01; div(phirb,alpha) Gauss interfaceCompression; : : : } Code:
Create time Create polyMesh for time = 0 Time = 0 Mesh stats points: 93636 faces: 267729 internal faces: 254991 cells: 87120 boundary patches: 3 point zones: 0 face zones: 0 cell zones: 1 Overall number of cells of each type: hexahedra: 87120 prisms: 0 wedges: 0 pyramids: 0 tet wedges: 0 tetrahedra: 0 polyhedra: 0 Checking topology... Boundary definition OK. Cell to face addressing OK. Point usage OK. Upper triangular ordering OK. Face vertices OK. Number of regions: 1 (OK). Checking patch topology for multiply connected surfaces ... Patch Faces Points Surface topology inlet 2640 2754 ok (non-closed singly connected) outlet 2640 2754 ok (non-closed singly connected) heatWall 7458 7684 ok (non-closed singly connected) Checking geometry... Overall domain bounding box (0 0 0) (0.02 0.01 0.01) Mesh (non-empty, non-wedge) directions (1 1 1) Mesh (non-empty) directions (1 1 1) Boundary openness (3.88444e-16 1.23164e-16 -3.56799e-15) OK. Max cell openness = 8.82326e-17 OK. Max aspect ratio = 1.33333 OK. Minumum face area = 7.5e-08. Maximum face area = 1.0101e-07. Face area magnitudes OK. Min volume = 2.27273e-11. Max volume = 2.52525e-11. Total volume = 2e-06. Cell volumes OK. Mesh non-orthogonality Max: 0 average: 0 Non-orthogonality check OK. Face pyramids OK. Max skewness = 0.000109995 OK. Coupled point location match (average 0) OK. Mesh OK. Time = 0.0005 Mesh stats points: 95614 faces: 272670 internal faces: 259779 cells: 88618 boundary patches: 3 point zones: 0 face zones: 0 cell zones: 1 Overall number of cells of each type: hexahedra: 88339 prisms: 0 wedges: 0 pyramids: 0 tet wedges: 0 tetrahedra: 0 polyhedra: 279 Checking topology... Boundary definition OK. Cell to face addressing OK. Point usage OK. Upper triangular ordering OK. Face vertices OK. Number of regions: 1 (OK). Checking patch topology for multiply connected surfaces ... Patch Faces Points Surface topology inlet 2640 2754 ok (non-closed singly connected) outlet 2640 2754 ok (non-closed singly connected) heatWall 7611 7859 ok (non-closed singly connected) Checking geometry... Overall domain bounding box (0 0 0) (0.02 0.01 0.01) Mesh (non-empty, non-wedge) directions (1 1 1) Mesh (non-empty) directions (1 1 1) Boundary openness (-4.07224e-16 3.9387e-17 -3.50976e-15) OK. Max cell openness = 1.76465e-16 OK. Max aspect ratio = 1.33336 OK. Minumum face area = 4.6875e-09. Maximum face area = 1.01015e-07. Face area magnitudes OK. Min volume = 3.55078e-13. Max volume = 2.52538e-11. Total volume = 2e-06. Cell volumes OK. Mesh non-orthogonality Max: 29.6211 average: 1.53168 Non-orthogonality check OK. Face pyramids OK. Max skewness = 0.334633 OK. Coupled point location match (average 0) OK. Mesh OK. Code:
volScalarField gradT = mag(fvc::grad(T)); volScalarField gradTt = mag(fvc::grad(T-TSat)); Info << min(gradT) << max(gradT) << min(gradTt) << max(gradTt) << endl; |
|
January 20, 2014, 09:12 |
|
#5 |
Senior Member
|
Hi,
Concerning grad(T) and grad(T - Tsat), as Tsat is constant, grad(Tsat) = 0 and grad(T) = grad(T - Tsat). From you graphs I can see the areas of constant temperature, so in these areas grad(T) will be 0. And finally negative numbers - we need to continue guessing what are the real initial and boundary conditions. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
question on simulating rotating channel with a pressure gradient | huangxianbei | CFX | 10 | January 14, 2014 23:00 |
Crank Nicolson scheme | msrinath80 | OpenFOAM Running, Solving & CFD | 6 | November 14, 2010 13:59 |
Question about gamma intgerpolation scheme | titio | OpenFOAM Running, Solving & CFD | 0 | July 26, 2010 10:22 |
Scheme file for sinusoidal channel flow | elobb | FLUENT | 0 | November 24, 2009 10:27 |
Question about meshing / solution scheme of CFX | Coriolius | CFX | 8 | August 1, 2004 18:39 |