|
[Sponsors] |
interface reconstruction and point value access |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 12, 2015, 21:39 |
interface reconstruction and point value access
|
#1 |
Member
james wilson
Join Date: Aug 2014
Location: Orlando, Fl
Posts: 39
Rep Power: 12 |
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 } } Code:
grep -n "0.146 0.289199 0.0146" ~/Desktop/damBreak/log" 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)) 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 Last edited by wyldckat; May 18, 2015 at 16:57. Reason: fixed link |
|
May 18, 2015, 17:03 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Greetings James,
I can't figure out why you need the 8 extreme points of the mesh, but it would be helpful to know why you need them. I ask this because the "alpha.water" is only available at the centre of the cells and/or the centre of the faces on the boundary mesh. In order to have the "alpha.water" values at the extremities of the mesh, you would need to interpolate those values. The closest I can think of is the example utility kit provided here: https://github.com/wyldckat/reconstr...rpolate-fields Best regards, Bruno
__________________
|
|
May 18, 2015, 20:31 |
|
#3 |
Member
james wilson
Join Date: Aug 2014
Location: Orlando, Fl
Posts: 39
Rep Power: 12 |
Thanks for following up Bruno. I am reconstructing the fluid/fluid interface such that I can develop a more accurate surface tension force in a solver I have assembled using interFoam. Please see pg.25, Fig.3.2 (right) of:
http://tuprints.ulb.tu-darmstadt.de/...Kunkelmann.pdf for reference to point interpolated values. Since the tangential surface tension force is calculated using the interface normal and local curvature, the use of the gradient operator is commonly utilized. fvc::grad(alpha1)/(...) (or similar) get a rough estimate of the interface normal. This rough estimate tends towards large parasitic currents. By following a method similar to that which is described in the link above, the orientation of the interface can be determined with greater precision by using point interpolated values. The orientation of the interface and the interface itself is then defined in a way where it is continuous from cell to cell (Fig.3.5b in same link). Ive seen some interesting threads regarding cells adjacent to a given cell (http://www.cfd-online.com/Forums/ope...ent-cells.html). I'm more interested in all of the cells sharing a given point where the average of alpha1[celli] sharing some point would be averaged to yield the results shown in the link above. Constructing the iso-plane at alpha.water=0.5 would require some geometry skills and would also rely on a consistent numbering of points and cells in the domain. If I can predictably identify for a given cell, all of its constituent points, and the adjacent cells for each of those points, I could determine the orientation of the iso-plane (alpha.water=0.5) cutting that cell. That's it! easier said than done, I know : ) Thanks for your time, James **EDIT Here is a version of what I'm looking for: http://www.cfd-online.com/Forums/ope...rpolation.html It appears to be available in 1.6-ext. Perhaps I can look at the src and port it for OF230. Bruno, you seem to be the resident porting expert around these parts ; ) Last edited by jameswilson620; May 18, 2015 at 20:38. Reason: Additional content |
|
May 18, 2015, 21:58 |
|
#4 |
Member
james wilson
Join Date: Aug 2014
Location: Orlando, Fl
Posts: 39
Rep Power: 12 |
Sorry about this.. I made some good progress. I will follow up with further questions as I know they will arise. In interFoam, I added these
To createFields: Code:
// Initialize a pointMesh object pointMesh pMesh(mesh); pointScalarField pValues ( IOobject ( "pValues", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), pMesh, dimensionedScalar("scalar", dimless, 0.0), "zeroGradient" ); Code:
... #include "fixedFluxPressureFvPatchScalarField.H" //ADD #include "volPointInterpolation.H" #include "pointMesh.H" #include "pointFields.H" #include "fixedValuePointPatchFields.H" //END // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { ... Code:
const volPointInterpolation& pInterp = volPointInterpolation::New(mesh); pointScalarField alpha1p(pInterp.interpolate(alpha1)); pValues.internalField() = alpha1p; pValues.write(); http://repo.or.cz/w/OpenFOAM-1.6.x.g...polationTest.C http://www.cfd-online.com/Forums/ope...alarfield.html http://www.cfd-online.com/Forums/ope...alarfield.html See attached for the ideal end result of what I wish to do. paraview builds the isocontour at alpha.water=0.5 automatically; I need to build this isocontour manually during runtime. I will have issues orienting the local points in each of the cells such that they draw the hex to which they belong. James |
|
September 20, 2015, 09:38 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Greetings James,
I had this thread of yours on my to-do list for a long time and only today did I finally manage to get back to it. From what I can understand, you've already solved this issue. The only thing I can think of that might come in handy beyond this is the discretization schemes that use vertexes instead of cells and faces, as reported here: http://www.cfd-online.com/Forums/ope...mesh-pipe.html Best regards, Bruno |
|
November 9, 2015, 16:29 |
|
#6 | |
New Member
Mostafa Mobli
Join Date: Feb 2015
Posts: 8
Rep Power: 11 |
Quote:
where you able to successfully implement the contour-based volume of fluid in openfoam? As far as I understood, the code you have included here can interpolate the values of alpha to corners, right? how did you do the rest? I would appreciate it if you could give me some details and insights on how to do the rest of implementation. bests mostafa |
||
April 7, 2016, 14:28 |
Isosurface based interface reconstruction and advection
|
#7 |
Member
Johan Roenby
Join Date: May 2011
Location: Denmark
Posts: 93
Rep Power: 21 |
Hi James and others
Just stumpled upon this thread. You probably made your own isosurface implementation by now. But if not, I might be able to help you. Have a look at my submitted paper here: http://arxiv.org/abs/1601.05392 The IsoAdvector code will be released as open source once the paper is out. But if you are interested, I can share it with you before. Cheers, Johan |
|
April 7, 2016, 14:33 |
|
#8 | |
New Member
Mostafa Mobli
Join Date: Feb 2015
Posts: 8
Rep Power: 11 |
Quote:
Dear Johan I am still struggling with the interface reconstruction, I would much appreciate it if you could send the IsoAdvector code. My email address is: mobli@email.sc.edu Bests Mostafa |
||
June 10, 2016, 14:09 |
|
#9 | |
New Member
Emanuele
Join Date: Feb 2014
Posts: 4
Rep Power: 12 |
Quote:
I'm extremely interested in the IsoAdvector code...Could i have more information about that? My e-mail is emateo84@hotmail.it regards emanuele |
||
Tags |
cell id, interface reconstruction, interfoam, point id |
|
|
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 12:28 |
VOF: Trouble in interface reconstruction | alame005 | Main CFD Forum | 0 | February 14, 2013 16:52 |