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

C_volume sum

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

Like Tree1Likes
  • 1 Post By coglione

Reply
 
LinkBack Thread Tools Display Modes
Old   March 28, 2009, 02:28
Default C_volume sum
  #1
los
Member
 
Tiago Macarios
Join Date: Mar 2009
Posts: 35
Rep Power: 7
los is on a distinguished road
I am using the following code to try to sum the volume of a specific domain, but it returns me the sum of all domains. What is wrong with it? Thanks for you help =D

void volume (int ID)
{
Domain *domain = Get_Domain(1);
Thread *t = Lookup_Thread(domain,ID);
cell_t c;
double VOLMOTC=0.0;

thread_loop_c(t,domain)
{
begin_c_loop(c,t)
{
VOLMOTC +=C_VOLUME(c,t);
}
end_c_loop(c,t)
}

Message0("Volume integral: %f\n", VOLMOTC);

}
los is offline   Reply With Quote

Old   March 30, 2009, 09:14
Default
  #2
Senior Member
 
Max
Join Date: Mar 2009
Posts: 131
Rep Power: 7
coglione is on a distinguished road
Hello los

as it name implies thread_loop_c(t,domain) loops over all cell threads in your domain and thus neglects the previous specification with ID. Omitting the outer loop will do what you want.

cheers
DungPham likes this.
coglione 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
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 15:33
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 14:09
Transient simulation not converging skabilan OpenFOAM Running, Solving & CFD 12 September 17, 2007 17:48
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07


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