|
[Sponsors] |
December 2, 2009, 11:29 |
interpolate field to sampledPlane
|
#1 |
Member
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17 |
Dear All,
I'm trying to average a field, e.g. p, over a plane as, plane xPl(x, n); sampledPlane smpPl("smpPl", mesh, xPl,word::null,false); const scalarField pPl(smpPl.sample(p)); av_p = smpPl.average(pPl); The problem is that the sampled value is directly taken as the cell center value and not interpolated from cell centers to the plane. Any ideas how to interpolate onto the plane and then average? I've tried .interpolate(pInt) instead of .sample(p) where pInt is constructed as a volPointInterpolation class. It compiles but gives me the following error when trying to average, size mismatch: field (384) != surface (377) Thanks /NW |
|
December 9, 2009, 12:35 |
|
#2 |
Member
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17 |
From the forum I've understood that there is a bug in OF-1.5 which should be fixed for OF-1.6. So, I've installed version 1.6 and now trying my code but without success when trying to compile.
I'm getting an error when trying #include "sampledPlane.H" as follows, OpenFOAM-1.6/src/sampling/lnInclude/cuttingPlane.H:49:27: error: MeshedSurface.H: No such file or directory In file included from /scratch/nwinkler/OpenFOAM/OpenFOAM-1.6/src/sampling/lnInclude/sampledPlane.H:40, And I can not understand from doxygen which other classes to use to obtain a sampledPlane with interpolated values, anyone? All the Best /NW |
|
December 10, 2009, 08:49 |
|
#3 |
Member
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17 |
Ok. I got it to compile after including surfMesh as an EXE_INC = \ in /Make/options and constructing a sampledPlane with 4 arguments, not 5 as in OF-1.5.
The problem is now that my sampledPlane is empty, which it's not in OF-1.5. Is there possibly a bug in the new version of sampledPlane, with a simple fix? /NW |
|
January 5, 2010, 10:34 |
|
#4 |
Member
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17 |
Any new ideas of how to obtain averaged data over a plane from interpolated values, OF-1.5 or 1.6?
Thanks /NW |
|
January 29, 2010, 07:18 |
|
#5 |
Member
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17 |
Thanks to Mattijs I got it to work!
Info<< "Reading field p\n" << endl; volScalarField p ( IOobject ( "p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); interpolationCellPoint<scalar> pInterp(p); plane pl(point(0.0,2.5e-4,0.0), vector(0,1,0)); sampledPlane spl("planeY", mesh, pl); spl.update(); scalarField pInterpPl(spl.interpolate(pInterp)); SubList<face> splFaces(spl.faces(), spl.faces().size()); primitivePatch primitivePtch(splFaces, spl.points()); primitivePatchInterpolation primPatchInterp(primitivePtch); scalarField pInterpPlFaces(primPatchInterp.pointToFaceInterpol ate(pInterpPl)); Info << "spl.average(pInterpPlFaces) = " << spl.average(pInterpPlFaces) << endl; |
|
October 13, 2011, 09:31 |
|
#6 | |
New Member
Ali Q Raeini
Join Date: Feb 2010
Posts: 24
Rep Power: 16 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Phase Field modeling in OpenFOAM | adona058 | OpenFOAM Running, Solving & CFD | 35 | November 16, 2021 01:16 |
Adding Temperature field to IcoFoam | yapalparvi | OpenFOAM Programming & Development | 14 | November 19, 2015 05:57 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Porosity field in Fluent | wojciech | FLUENT | 1 | September 20, 2010 12:19 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |