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

"Compute_Force_And_Moment" for parrallel solver

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

Like Tree1Likes
  • 1 Post By zhipengfeng

Reply
 
LinkBack Thread Tools Display Modes
Old   March 17, 2009, 08:48
Default "Compute_Force_And_Moment" for parrallel solver
  #1
New Member
 
fengzhipeng
Join Date: Mar 2009
Posts: 4
Rep Power: 7
zhipengfeng is on a distinguished road
hi :
I'm trying to make a simulation using a "Compute_Force_And_Moment" (detailed at the end of this message) and in order to reduce computing time, I want to use Fluent parallel solver. This UDF works using Fluent serial solver but it doesn't work anymore when I choose the parallel solver. Could anybody help me to rewrite this ""Compute_Force_And_Moment" " UDF for Fluent parallel solver?

Thanks

zhipengfeng
--------------------------------------------------------------
#include "udf.h"
#include "mem.h"
#include "f_Wall.h"
#include "unsteady.h"
#include "stdlib.h"
#include "stdio.h"
#define ND_ND 3
DEFINE_EXECUTE_AT_END(execute_at_end)
{
#if !RP_HOST
face_t f;
cell_t c;
real current_time=CURRENT_TIME;
int time_N=N_TIME;
real f_car1[ND_ND],m_car1[ND_ND],x_cg_car1[ND_ND];
#endif

#if !RP_NODE
FILE *fp1,*fp2,*fp3,*fp4,*fp5,*fp6;
#endif

#if !RP_HOST
Domain *domain=Get_Domain(1);
Thread *car1=Lookup_Thread(domain,7);
real velocity=40;
real x_car1=772.7;
/*----------------------------------*/
f_car1[0]=0.0;
f_car1[1]=0.0;
f_car1[2]=0.0;
m_car1[0]=0.0;
m_car1[1]=0.0;
m_car1[2]=0.0;

x_cg_car1[0]=0;
x_cg_car1[1]=188.2;
x_cg_car1[2]=-1.3;
x_cg_car1[0]=x_car1+velocity*(current_time);

Compute_Force_And_Moment (domain,car1,x_cg_car1,f_car1,m_car1,TRUE);
#endif
/*-------------------------------------------------------------------------------*/
#if !RP_NODE
fp1=fopen("car1_Fx.txt","a+");
fprintf(fp1, "%15.4f\t%d\n", f_car1[0],time_N);
fclose(fp1);
fp2=fopen("car1_Fy.txt","a+");
fprintf(fp2, "%15.4f\t%d\n", f_car1[1],time_N);
fclose(fp2);
fp3=fopen("car1_Fz.txt","a+");
fprintf(fp3, "%15.4f\t%d\n", f_car1[2],time_N);
fclose(fp3);
fp4=fopen("car1_Mx.txt","a+");
fprintf(fp4, "%15.4f\t%d\n", m_car1[0],time_N);
fclose(fp4);
fp5=fopen("car1_My.txt","a+");
fprintf(fp5, "%15.4f\t%d\n", m_car1[1],time_N);
fclose(fp5);
fp6=fopen("car1_Mz.txt","a+");
fprintf(fp6, "%15.4f\t%d\n", m_car1[2],time_N);
fclose(fp6);
#endif
}
mm.abdollahzadeh likes this.
zhipengfeng is offline   Reply With Quote

Old   March 18, 2009, 05:19
Default
  #2
Member
 
Join Date: Mar 2009
Posts: 35
Rep Power: 7
panda is on a distinguished road
You must use node_to_host first to transfer the variable values to host before you write the forces and moments to your own file at host.
panda is offline   Reply With Quote

Old   March 18, 2009, 07:08
Default
  #3
New Member
 
fengzhipeng
Join Date: Mar 2009
Posts: 4
Rep Power: 7
zhipengfeng is on a distinguished road
thanks a lot! Let me have a try.
zhipengfeng 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
"Notice" during solver run Tudor Miron CFX 2 March 11, 2004 16:48
"""Source Term in UDS""" Sebeci FLUENT 6 April 16, 2003 13:46
FLUENTUDF+"TIME" VARIABLE NAME IN COUP+EXP SOLVER? Taner FLUENT 4 April 16, 2002 05:58
"laminar" incomp. N-S eqs. for "turbulent" flows wowakai Main CFD Forum 4 November 27, 2001 06:48
what's the difference between "successive substitution" and "segregated" solutions?? wai Main CFD Forum 1 December 28, 1998 10:24


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