CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Mesh Utilities

Selecting cellzone using cellSet in OpenFOAM-1.7.0

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 25, 2012, 05:48
Default Selecting cellzone using cellSet in OpenFOAM-1.7.0
  #1
New Member
 
deok-kyu choi
Join Date: Feb 2012
Location: Rep. of Korea
Posts: 12
Rep Power: 5
ggoggodak85 is on a distinguished road
Dear all,

I'm trying to calculate coriolis force.
I've already made the mesh in constant dir.

There are two cellzones, cellTable_1(fluid region), cellTable_2(fluid region with rotating)

How can I calculate the Radius for only cellTable_2?
running following code, the coriolis force is calculated in every cells.

I guess just modifying mesh.C() to mesh in cellTable_2 in volVectorField Radius.

can anyone help on this issue? Give me a great idea for solving

Thank you all.


================================================== =============
Here is the my code.

#include "fvCFD.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"

forAll(mesh.cellZones(), i)
{
const cellZone& zone = mesh.cellZones()[i];

if (zone.name()=="cellTable_2")
{
const labelList& cellLabels = mesh.cellZones()[i];

Info << "Found matching zone " << zone.name() << " with " << cellLabels.size() << " cells." << endl;

dimensionedVector Omega
(
"Omega",
dimensionSet(0, 0, -1, 0, 0, 0, 0),
//RPM 10 rad/s
vector(0, 10, 0)
);

// Define centor of rotating frame
dimensionedVector Origin
(
"Origin",
dimensionSet(0, 1, 0, 0, 0, 0, 0),
point(0.0, 0.0, 0.0)
);

volVectorField Radius = (mesh.C() - Origin);

// Calculate the coriolis force in entire cells
volVectorField Fcoriolis
IOobject
(
"Fcoriolis",
runTime.timeName(),
mesh
),
Omega ^ Radius
);
Fcoriolis.write();
}
}
return 0;
}
ggoggodak85 is offline   Reply With Quote

Reply

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
2D Mesh Generation Tutorial for GMSH aeroslacker Open Source Meshers: Gmsh, Netgen, CGNS, ... 12 January 19, 2012 04:52
OpenFOAM 1.7.0 Released opencfd OpenFOAM Announcements from ESI-OpenCFD 1 May 26, 2011 03:09
OpenFoam 1.7.0 on RHEL 4.6 Pankaj Singh OpenFOAM Installation 12 October 24, 2010 20:04
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 06:25
OpenFOAM 14 parallel troubles msrinath80 OpenFOAM Running, Solving & CFD 14 July 5, 2007 04:51


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