|
[Sponsors] |
October 31, 2011, 19:35 |
Vector operations on Cell Zones
|
#1 |
Member
Ganesh Vijayakumar
Join Date: Jan 2010
Posts: 44
Rep Power: 16 |
Can I get standard vector operations done on certain cell zones alone.. For e.g fvm::laplacian(U) or fvc::grad(U)?
|
|
October 31, 2011, 23:33 |
|
#2 |
Senior Member
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25 |
Take a look at fvMeshSubset. This allows you to define an fvMesh on a set of cells (where exposed internal faces are added to a "default" patch).
Once you have this defined, you can define GeometricFields (like volVectorFields such as velocity - U) using this mesh subset, and subsequently, vector calculus operators as well. Boundary conditions, etc will all be handled automatically. |
|
November 1, 2011, 01:11 |
Example?
|
#3 |
Member
Ganesh Vijayakumar
Join Date: Jan 2010
Posts: 44
Rep Power: 16 |
hi Sandeep,
Could you point me to an example where fvMeshSubset is used inside a code? That would be extremely helpful. |
|
November 1, 2011, 08:41 |
|
#4 |
Senior Member
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25 |
I can't seem to find any examples, but you can accumulate a set of cells in a labelHashSet, and use the fvMeshSubset::setCellSubset member function to construct your mesh. From then on, field creation, etc is the same as fvMesh, but you would substitute the fvMeshSubset::subMesh() member function instead of a regular mesh.
|
|
February 19, 2013, 12:39 |
Urgent help on fvMeshSubset
|
#5 |
New Member
Fabian Wein
Join Date: Jan 2013
Posts: 13
Rep Power: 13 |
I need to do the same and came to the same idea. My problem is, that setCellSubset fails.
Here my example code: labelHashSet sub; for(int i = 0; i < mesh.C().internalField().size(); i++) { const vector& v = mesh.C().internalField()[i]; if(v.x() > 8.75-1e-5 && v.x() < 13.75+1e-5 && v.y() > 1.25-1e-5 && v.y() < 6.25+1e-5 && v.z() > 0.5595-1e-5 && v.z() < 1.5605+1e-5) { sub.insert(i); } } fvMeshSubset sm(mesh); sm.setCellSubset(sub); I have the following problem: Number of cells in new mesh: 18 Number of faces in new mesh: 75 Number of points in new mesh: 48 --> FOAM FATAL ERROR: Cannot find face 281 in any of the patches 3 ( sideWalls topWalls inlet ) It seems your patches are not consistent with the mesh : internalFaces:278 total number of faces:442 From function label polyBoundaryMesh::whichPatch(const label faceIndex) const in file meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C at line 541. FOAM aborting #0 Foam::error:rintStack(Foam::Ostream&) in "/opt/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1 Foam::error::abort() in "/opt/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 Foam:olyBoundaryMesh::whichPatch(int) const in "/opt/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #3 Foam::fvMeshSubset::setCellSubset(Foam::HashSet<in t, Foam::Hash<int> > const&, int) in "/opt/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so" #4 Any help is very much appreciated!! Thanks, Fabian |
|
February 21, 2013, 09:24 |
Solved
|
#6 |
New Member
Fabian Wein
Join Date: Jan 2013
Posts: 13
Rep Power: 13 |
my problem was, that external faces where not assigned to a label and the internal mesh intersects these external faces.
|
|
Tags |
cellzone |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] how to extract cell zones by cgnsToFoam | Ohbuchi | OpenFOAM Meshing & Mesh Conversion | 0 | July 22, 2010 05:19 |
Cells with t below lower limit | Purushothama | Siemens | 2 | May 31, 2010 22:58 |
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues | michele | OpenFOAM Meshing & Mesh Conversion | 2 | July 15, 2005 05:15 |
Warning 097- | AB | Siemens | 6 | November 15, 2004 05:41 |
Tracking/Modifying Cell Zones | Greg Perkins | FLUENT | 1 | November 7, 2000 00:35 |