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

leastSquares gradient on tet meshes

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 3, 2010, 18:21
Default leastSquares gradient on tet meshes
  #1
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 386
Rep Power: 15
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, 17:23
Default
  #2
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 386
Rep Power: 15
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

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting prism to inflate into mixed tet-hex meshes Joe CFX 16 October 10, 2011 07: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
Why are hex meshes better than tet? bigphil OpenFOAM Meshing Format & General Technical 9 May 19, 2009 05:45
Diffusion in tet meshes Johnson Main CFD Forum 1 October 13, 2003 02:59
FV discretisation on tet meshes peter grafenberger Main CFD Forum 7 October 29, 1999 06:32


All times are GMT -4. The time now is 17:21.