CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Vector operations on Cell Zones

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 31, 2011, 19:35
Default Vector operations on Cell Zones
  #1
Member
 
Ganesh Vijayakumar
Join Date: Jan 2010
Posts: 43
Rep Power: 7
ganeshv is on a distinguished road
Can I get standard vector operations done on certain cell zones alone.. For e.g fvm::laplacian(U) or fvc::grad(U)?
ganeshv is offline   Reply With Quote

Old   October 31, 2011, 23:33
Default
  #2
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 386
Rep Power: 15
deepsterblue will become famous soon enough
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.
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   November 1, 2011, 01:11
Default Example?
  #3
Member
 
Ganesh Vijayakumar
Join Date: Jan 2010
Posts: 43
Rep Power: 7
ganeshv is on a distinguished road
hi Sandeep,

Could you point me to an example where fvMeshSubset is used inside a code? That would be extremely helpful.
ganeshv is offline   Reply With Quote

Old   November 1, 2011, 08:41
Default
  #4
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 386
Rep Power: 15
deepsterblue will become famous soon enough
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.
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   February 19, 2013, 12:39
Default Urgent help on fvMeshSubset
  #5
New Member
 
Fabian Wein
Join Date: Jan 2013
Posts: 13
Rep Power: 4
Fabian_W is on a distinguished road
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
Fabian_W is offline   Reply With Quote

Old   February 21, 2013, 09:24
Default Solved
  #6
New Member
 
Fabian Wein
Join Date: Jan 2013
Posts: 13
Rep Power: 4
Fabian_W is on a distinguished road
my problem was, that external faces where not assigned to a label and the internal mesh intersects these external faces.
Fabian_W is offline   Reply With Quote

Reply

Tags
cellzone

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
how to extract cell zones by cgnsToFoam Ohbuchi OpenFOAM Meshing & Mesh Conversion 0 July 22, 2010 04:19
Cells with t below lower limit Purushothama CD-adapco 2 May 31, 2010 21:58
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15
Warning 097- AB CD-adapco 6 November 15, 2004 05:41
Tracking/Modifying Cell Zones Greg Perkins FLUENT 1 November 7, 2000 00:35


All times are GMT -4. The time now is 00:43.