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

Coded FunctionObject to calculate distance to axis? Nothing written

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2018, 19:23
Default Coded FunctionObject to calculate distance to axis? Nothing written
  #1
Senior Member
 
M. Montero
Join Date: Mar 2009
Location: Madrid
Posts: 155
Rep Power: 17
be_inspired is on a distinguished road
Hi all,

Using OF-v1612+:
For an axi-symmetric simulation, I want to calculate the distance from every cell to the axis of rotation. After that, I want to generate an iso-surface of radius equal to 50 centimeters, and over that isosurface, then I could have the velocity field that is what I want lastly (using sampling).

The piece of code to calculate the cell coordinates would be something like this but nothing is written:


functions
{
radius
{
type coded;
functionObjectLibs ("libutilityFunctionObjects.so");
name radius;
writeControl writeTime;
redirectType radius;
codeExecute
#{
// Lookup U

const volVectorField& C = mesh().C();
//const volScalarField zcoord = mesh.C().component(vector::Z);
//const volScalarField ycoord = mesh.C().component(vector::Y);
//volScalarField ycoord = ;
//zcoord = mesh.C().component(vector::Z);
//const volScalarField& radius = ((y**2+z**2)**0.5);
// Write
C.write();
Info<< endl << "hello test"<<endl;
#};

}

Any suggestion would be great.
Best Regards
be_inspired is offline   Reply With Quote

Reply


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
Unsteady Boundary Profile with data file Arianna FLUENT 34 July 29, 2019 17:35
Compute/Extract cell wall distance Ionut G Fluent UDF and Scheme Programming 0 March 23, 2017 08:05
calculate distance from wall to neighbourig cell centroid rr123 Fluent UDF and Scheme Programming 39 March 14, 2017 02:41
Tecplot 'cannot calculate axis range' SeungWon, Jeon Tecplot 1 July 15, 2008 00:39
Can Tecplot calculate isosurface area alon axis x? leaf Tecplot 0 May 21, 2007 13:20


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