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

leastSquares gradient on tet meshes

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 3, 2010, 19:21
Default leastSquares gradient on tet meshes
  #1
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
I've been trying out a few gradient schemes recently on tet-meshes, of which I find the leastSquares scheme to be most accurate. However, I find that the results are quite awkward at boundaries. My test case is quite simple (tet-mesh in a box - see attached), and the driver code is given:

Code:
#include "fvCFD.H"

int main(int argc, char** argv)
{
#   include "setRootCase.H"
#   include "createTime.H"
#   include "createMesh.H"

    volScalarField alpha
    (
        IOobject
        (
            "alpha",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        (mesh.C() & vector(2,3,1))
    );

    // Set values for the field
    volVectorField gradAlpha = fvc::grad(alpha);

    Info << "Writing out the gradient" << endl;

    gradAlpha.write();

    return 0;
}
I would expect grad(alpha) to be a constant vector(2,3,1), which is mostly the case at interior cells, but not so at cells the boundary. Am I doing something wrong?

Attachments:
http://www.ecs.umass.edu/~smenon/tarballs/testGrad.gz
http://www.ecs.umass.edu/~smenon/tarballs/boxTestCase.gz

Thanks in advance.
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   June 4, 2010, 18:23
Default
  #2
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
Well, turns out that this was a false alarm. Bug-fix in revision 1716 of OF-1.5-dev.

Apologies.
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue 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
[Technical] Why are hex meshes better than tet? bigphil OpenFOAM Meshing & Mesh Conversion 10 July 18, 2016 13:20
Getting prism to inflate into mixed tet-hex meshes Joe CFX 16 October 10, 2011 08:06
[ICEM] how can i create a consistent transitions between tet and hex? specifically my model? snailstb ANSYS Meshing & Geometry 3 March 15, 2010 21:26
Diffusion in tet meshes Johnson Main CFD Forum 1 October 13, 2003 03:59
FV discretisation on tet meshes peter grafenberger Main CFD Forum 7 October 29, 1999 07:32


All times are GMT -4. The time now is 14:19.