# Calculate Force over beam

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

 September 10, 2020, 10:13 Calculate Force over beam #1 Member   Join Date: Jan 2020 Posts: 31 Rep Power: 5 Hi, I am trying to calculate the force on the beam! the formula is like this: L is the length of the beam. and I am using this code(part of the code) in DEFINE_EXECUTE_AT_END macro: Domain *d= Get_Domain(1); Thread *t=Lookup_Thread(d,ID); face_t f; begin_f_loop(f, t) if (PRINCIPAL_FACE_P(f,t)) { F_CENTROID(x,f,t); yy = x[0]; F_AREA(area,f,t); phi = 1-cos((PI/2)*(yy/L)); Fpy+=L*area[1]*F_P(f,t)*phi; } fout = fopen ("Pressure.out","a"); fprintf(fout," %f %f %f %f %f %f %f\n",time,area[1],Fpy,F_P(f,t),phi); fclose(fout); end_f_loop(f, t) Fy = Fpy; #if RP_NODE /* SERIAL or NODE */ Fy=PRF_GRSUM1(Fy); #endif /* RP_NODE */ Is this true?! should I multiply (L) for calculating Force (Fpy+=L*area[1]*F_P(f,t)*phi) THANKS

 September 15, 2020, 06:00 #2 Senior Member   Alexander Join Date: Apr 2013 Posts: 2,347 Rep Power: 33 unfortunately, I don't see any formula, may be, cause the picture is blocked. I have no Idea, if you need L (length of the beam) in the formula or not, so I can comment the code only most likely you have problems in writing to file Code: ```fout = fopen ("Pressure.out","a"); fprintf(fout," %f %f %f %f %f %f %f\n",time,area[1],Fpy,F_P(f,t),phi); fclose(fout);``` cause to write into file in parallel mode you should transfer data from computational modes to host first. Read Ansys Fluent Customization manual for detailed information. Look for parallelization chapter if you remove that part, I think, code should work well __________________ best regards ****************************** press LIKE if this message was helpful

September 16, 2020, 09:24
#3
Member

Join Date: Jan 2020
Posts: 31
Rep Power: 5
Quote:
 Originally Posted by AlexanderZ unfortunately, I don't see any formula, may be, cause the picture is blocked. I have no Idea, if you need L (length of the beam) in the formula or not, so I can comment the code only most likely you have problems in writing to file Code: ```fout = fopen ("Pressure.out","a"); fprintf(fout," %f %f %f %f %f %f %f\n",time,area[1],Fpy,F_P(f,t),phi); fclose(fout);``` cause to write into file in parallel mode you should transfer data from computational modes to host first. Read Ansys Fluent Customization manual for detailed information. Look for parallelization chapter if you remove that part, I think, code should work well
Thank you Alexander, I am trying to attach the picture which describe the formulas.
here is my question: should I multiply (L) for calculating Force or not?!(Fpy+=L*area[1]*F_P(f,t)*phi)
and for more details I use the series form when I open fluent not parallel
Attached Images
 Force.png (44.2 KB, 2 views)