CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[mesh manipulation] Selecting cellzone using cellSet in OpenFOAM-1.7.0

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

Reply
 
LinkBack Thread Tools Search this Thread 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: 14
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 Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 15:54
OpenFOAM v3.0+ ?? SBusch OpenFOAM 22 December 26, 2016 14:24
OpenFOAM Training: Programming CFD Course 12-13 and 19-20 April 2016 cfd.direct OpenFOAM Announcements from Other Sources 0 January 14, 2016 10:19
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 03:52
OpenFOAM 1.6.x, 1.7.0 and 1.7.x are not fully prepared to work with gcc-4.5.x wyldckat OpenFOAM Bugs 18 October 21, 2010 05:51


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