CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Is there any method for calculating each cells volume?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By ssavi22
  • 1 Post By macfly

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 24, 2016, 23:22
Default Is there any method for calculating each cells volume?
  #1
New Member
 
S.J Chung
Join Date: Mar 2015
Posts: 6
Rep Power: 11
ssavi22 is on a distinguished road
Hi guys.

I already calculate total volume of cell.

Use this code.
----------------------------------------------------------
#include "udf.h"

DEFINE_ON_DEMAND(demo_calc)
{
real volume, vol_tot;
Domain* domain;
Thread* t;
cell_t c;

vol_tot = 0.;
domain = Get_Domain(1);

thread_loop_c(t, domain)
{
begin_c_loop(c, t)
{
volume = C_VOLUME(c, t);
vol_tot += volume;
}
end_c_loop(c, t)
}
Message("Total Volume=%g", vol_tot);
}
------------------------------------------------------

After that, I want to calculate each (particle) cells volume.

But I can't find it.

Is there any sample code?
soheil_r7 likes this.
ssavi22 is offline   Reply With Quote

Old   April 25, 2016, 00:58
Default
  #2
Senior Member
 
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17
macfly is on a distinguished road
You could add this line to display cell volume:
Quote:
Originally Posted by ssavi22 View Post
Hi guys.

I already calculate total volume of cell.

Use this code.
----------------------------------------------------------
#include "udf.h"

DEFINE_ON_DEMAND(demo_calc)
{
real volume, vol_tot;
Domain* domain;
Thread* t;
cell_t c;

vol_tot = 0.;
domain = Get_Domain(1);

thread_loop_c(t, domain)
{
begin_c_loop(c, t)
{
volume = C_VOLUME(c, t);
Message("Cell Volume=%g", volume);
vol_tot += volume;
}
end_c_loop(c, t)
}
Message("Total Volume=%g", vol_tot);
}
------------------------------------------------------

After that, I want to calculate each (particle) cells volume.

But I can't find it.

Is there any sample code?
You could write cell volume to a text file, etc.
ssavi22 likes this.
macfly is offline   Reply With Quote

Reply

Tags
cell volume, udf


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
[snappyHexMesh] SnappyHexMesh for internal Flow vishwa OpenFOAM Meshing & Mesh Conversion 24 June 27, 2016 09:54
multiphaseEulerFoam (OF2.3.0) : Courant number explodes when running in parallel Mehrez OpenFOAM Running, Solving & CFD 10 May 18, 2016 12:44
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 14:06
Control Volume , Finite Volume, Finite Control Volume, Finite Element Method technocrat.prakash Main CFD Forum 1 April 24, 2010 20:24
Comparison: Finite Volume Method vs. Analytic Method m-fry Main CFD Forum 1 April 20, 2010 15:40


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