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

interface reconstruction and point value access

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By jameswilson620
  • 1 Post By moblimostafa
  • 2 Post By roenby

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   May 12, 2015, 20:39
Default interface reconstruction and point value access
  #1
Member
 
james wilson
Join Date: Aug 2014
Location: Orlando, Fl
Posts: 39
Rep Power: 11
jameswilson620 is on a distinguished road
Hello all,

Im looking to utilize interface reconstruction and require access to alpha.water, for a given cell, at all 8 points (assuming i'm using a hex).

I have seen: http://www.cfd-online.com/Forums/ope...ize-x-y-z.html

and it gets me close as I have dropped some "Info << stuff << endl;" lines in interfoam to see what all of the definitions are in the above link:

Code:
const faceList & ff = mesh.faces();
const pointField & pp = mesh.points();

forAll ( mesh.C(), celli)
{
    const cell & cc = mesh.cells()[celli];
    labelList pLabels(cc.labels(ff));
    pointField pLocal(pLabels.size(), vector::zero)
      forAll (pLabels, pointi)
      {
           pLocal[pointi] = pp[pLabels[pointi]];

           scalar xDim = Foam::max(pLocal & vector(1,0,0)) - Foam::min(pLocal & vector(1,0,0));

        Info  << endl << "celli:  " << celli << endl;
        Info  << "pointi:  " << pointi << endl;
        Info  << "pLabels[pointi]:  " << pLabels[pointi]<< endl;
        Info  << "pLocal[pointi]:  " << pLocal[pointi]<< endl;
        Info  << "pLocal:  " << pLocal<< endl;
            // And similar for yDim and zDim
    }  
}
I used damBreak as a test case for the snippet of code. I have utilized paraview to generate id's for the initial condition where the liquid corner point should have a value of 0.25. And it is (see attached image)! I dumped the dambreak simulation into a log file and used grep, knowing the coordinate location of the liquid corner point (see attached):

Code:
grep -n "0.146 0.289199 0.0146" ~/Desktop/damBreak/log"
Here is a sample from grep of the cells containing this pointID (6817) and coordinate location (0.146 0.289199 0.0146):

Code:
celli:  2265
pointi:  2
pLabels[pointi]:  6817
pLocal[pointi]:  (0.146 0.289199 0.0146)
pLocal:  8((0.146 0.282499 0) (0.146 0.289199 0) (0.146 0.289199 0.0146) (0 0 0) (0 0 0) (0 0 0) (0 0 0) (0 0 0))

...


celli:  2266
pointi:  5
pLabels[pointi]:  6817
pLocal[pointi]:  (0.146 0.289199 0.0146)
pLocal:  8((0.152636 0.282499 0) (0.152636 0.289199 0) (0.152636 0.289199 0.0146) (0.152636 0.282499 0.0146) (0.146 0.289199 0) (0.146 0.289199 0.0146) (0 0 0) (0 0 0))
note: since this is 2D, there should be 4 cells that own this point ID. There are 4. i am only showing two : )

So, I would like to gain access to alpha.water's point values during runtime in the same manner paraview would such that I can derive other fields based on the point values for alpha.water.

Thanks for your time!

PS any input on decoding the meaning of the definitions in the code snippet above is welcome ; )

James
Attached Images
File Type: jpg Screenshot from 2015-05-12 19:45:04.jpg (51.7 KB, 174 views)

Last edited by wyldckat; May 18, 2015 at 15:57. Reason: fixed link
jameswilson620 is offline   Reply With Quote

 

Tags
cell id, interface reconstruction, interfoam, point id


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
Reconstruction of the parallel case with dynamic mesh makaveli_lcf OpenFOAM Post-Processing 7 October 18, 2023 11:28
VOF: Trouble in interface reconstruction alame005 Main CFD Forum 0 February 14, 2013 15:52


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