|
[Sponsors] |
"Compute_Force_And_Moment" for parrallel solver |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 17, 2009, 07:48 |
"Compute_Force_And_Moment" for parrallel solver
|
#1 |
New Member
fengzhipeng
Join Date: Mar 2009
Posts: 4
Rep Power: 17 |
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 } |
|
March 18, 2009, 04:19 |
|
#2 |
Member
Join Date: Mar 2009
Posts: 35
Rep Power: 17 |
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.
|
|
March 18, 2009, 06:08 |
|
#3 |
New Member
fengzhipeng
Join Date: Mar 2009
Posts: 4
Rep Power: 17 |
thanks a lot! Let me have a try.
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |