|
[Sponsors] |
March 15, 2018, 23:01 |
Parallel processing for SDOF Dynamic mesh
|
#1 |
New Member
Seoul
Join Date: Jun 2017
Posts: 2
Rep Power: 0 |
Dear all,
I am trying to solve a problem using SDOF Dynamic mesh technique in fluent. Since the computation time in serial processing was high I decided to shift to parallel processing. UDF is compiled successfully and iterations began, but the velocity of boundary wall that is supposed to move is still zero. am sharing the udf below. Thank you for your time. #define cg_x0 0.02738587 DEFINE_SDOF_PROPERTIES(piston,prop,dt,time,dtime) { real po,p0,F,Fu,Ff1,Ff2,Fs,FD,P1,temp,u,Fp,myuw,myua,dp ,b,h,fc,poa,Pa,T,R,ma,AD,Li,Ao,Ap,ks,di,fc1,fc2,L, m,alpha1,alpha2,alpha2_1,D,po_1,Ff2_1,x; #if !RP_HOST Thread*t; face_t f; t=DT_THREAD(dt); #endif prop[SDOF_MASS] = 0.11532; prop[SDOF_ZERO_TRANS_X]=TRUE; prop[SDOF_ZERO_TRANS_Y]=TRUE; prop[SDOF_ZERO_TRANS_Z]=TRUE; prop[SDOF_ZERO_ROT_X]=TRUE; prop[SDOF_ZERO_ROT_Y]=TRUE; prop[SDOF_ZERO_ROT_Z]=TRUE; prop[SDOF_SYMMETRY_X] = 1; prop[SDOF_SYMMETRY_Y] = 0; prop[SDOF_SYMMETRY_Z] = 0; /* add forces*/ Pa=1.013e5; T=300; R=287; ma=1.2633e-4; AD=1.256e-3; Li=0.02; Ao=3.1415e-8; Ap=2.0687e-5; ks=10000; myuw=8.90e-4; dp=5.1322e-3; b=1.3741e-3; h=0.1381e-3; fc1=96.10; fc2=5.24; L=8.8395e-3; m=0.05766; myua=0.0000181; alpha1=0.2; alpha2=0.38; alpha2_1=0.45; D=0.02; #if !RP_HOST # if RP_NODE x=fabs (cg_x0 - DT_CG(dt)[1]); u=x/time; P1=433000; temp=(pow(((0.0285)/(0.0285+x)),1.4)); begin_f_loop(f,t) if(x<=0.007) { prop[SDOF_ZERO_TRANS_X]=FALSE; p0= C_P(f,t); FD=3.14*0.020*0.020*(((P1-(Pa))*temp)-Pa); poa=((0.5*6*myua*u*(D/2)*(1/(h*h)))+((P1)*temp)); Ff1=2*((alpha1*poa*3.14*D*b)+(poa*3.14*D*h)+(alpha 1*fc1)); po_1=(0.5*6*myua*u*(dp/2)*(1/(h*h))+p0); po=(0.5*6*myuw*u*(dp/2)*(1/(h*h))+p0); Ff2_1=2*((alpha2*po_1*3.14*dp*b)+(po_1*3.14*dp*h)+ (alpha2*fc2)); Ff2=2*((alpha2*po*3.14*dp*b)+(po*3.14*dp*h)+(alpha 2*fc1)); Fp=3.14*(dp/2)*(dp/2)*p0; Fs=ks*x; F=(FD-Fs-Ff1-Ff2-Fp); prop[SDOF_LOAD_F_X]= F; } else { prop[SDOF_ZERO_TRANS_Y]=TRUE; } Message("\n 2d : Updated 6DOF prop with time = %f, distance = %f\n", time,x); Message("\n 2d : new location = %g", DT_CG(dt)[1]); Message("\n 2d : Force on Piston = %f, p0 = %f\n, po = %f\n", F,p0,po); end_f_loop(f,t) # endif #endif } |
|
March 19, 2018, 05:16 |
|
#2 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
Hi Amohizin,
Is there any logic in where you have placed #if !RP_HOST and # if RP_NODE? It does not look right to me -- for a start, the #if RP_NODE means that this UDF will not work in serial. I would be tempted to remove them all -- on the RP_HOST process in parallel, the begin_f_loop...end_f_loop will do nothing (because there are no faces on the host), so it should be safe. Did the UDF work (but work slowly) in serial? From what I can see, apart from the previous paragraph, I cannot see why it would be any different. So you might want to start debugging your detailed calculations. Use Message0, so that you get information only from node0, for example: Code:
Message0("x = %g\n",x); Code:
if(f%10000 == 777) { Message0("f = %9d: x = %g\n",f,x); } Code:
x=fabs (cg_x0 - DT_CG(dt)[1]); Ed |
|
March 20, 2018, 03:33 |
|
#3 |
New Member
Seoul
Join Date: Jun 2017
Posts: 2
Rep Power: 0 |
Hi obscureed.
Thank you for the response. I didn't use #if !RP_HOST and # if RP_NODE lines in UDF I used for serial computing. and it was x=fabs (cg_x0 - DT_CG(dt)[1]); in original code. Apologies for that, it was a typo. Initially, I was working on axisymmetric geometry and Serial computing was fine. But now I had to work with 3D geometry and had to consider parallel processing to reduce the computation time. Once again thank you for pointing out the error. I am new to parallel processing. If possible could you guide me in converting the UDF to parallel processing? This is the UDF I used for serial processing. DEFINE_SDOF_PROPERTIES(piston,prop,dt,time,dtime) { real po,p0,F,Ff1,Ff2,Fs,FD,Fb,P1,temp,u,Fp,myuw,myua,dp ,b,h,fc,poa,Pa,T,R,ma,AD,Li,Ao,Ap,ks,di,fc1,fc2,L, m,alpha1,alpha2,D,po_1,Ff2_1,x; Thread*t; face_t f; t=DT_THREAD(dt); prop[SDOF_MASS] = 0.05766; prop[SDOF_ZERO_TRANS_X]=TRUE; prop[SDOF_ZERO_TRANS_Y]=TRUE; prop[SDOF_ZERO_TRANS_Z]=TRUE; prop[SDOF_ZERO_ROT_X]=TRUE; prop[SDOF_ZERO_ROT_Y]=TRUE; prop[SDOF_ZERO_ROT_Z]=TRUE; prop[SDOF_SYMMETRY_X] = 0; prop[SDOF_SYMMETRY_Y] = -1; prop[SDOF_SYMMETRY_Z] = 0; /* add forces*/ Pa=1.013e5; T=300; R=287; ma=1.2633e-4; AD=1.256e-3; Li=0.02; Ao=3.1415e-8; Ap=2.0687e-5; ks=4500; myuw=8.90e-4; dp=5.1322e-3; b=1.3741e-3; h=0.1381e-3; fc1=96.10; fc2=5.24; L=8.8395e-3; m=0.05766; myua=0.0000181; alpha1=0.2; alpha2=0.38; D=0.02; x=fabs (cg_x0 - DT_CG(dt)[0]); u=x/time; P1=433000;; temp=(pow(((0.0285)/(0.0285+x)),1.4)); begin_f_loop(f,t) if(x<=0.007) { prop[SDOF_ZERO_TRANS_X]=FALSE; p0= C_P(f,t); FD=3.14*0.020*0.020*(((P1-(Pa))*temp)-Pa); poa=((0.5*6*myua*u*(D/2)*(1/(h*h)))+((P1)*temp)); Ff1=2*((alpha1*poa*3.14*D*b)+(poa*3.14*D*h)+(alpha 1*fc1)); po_1=(0.5*6*myua*u*(dp/2)*(1/(h*h))+p0); po=(0.5*6*myuw*u*(dp/2)*(1/(h*h))+p0); Ff2_1=2*((alpha2*po_1*3.14*dp*b)+(po_1*3.14*dp*h)+ (alpha2*fc2)); Ff2=2*((alpha2*po*3.14*dp*b)+(po*3.14*dp*h)+(alpha 2*fc1)); Fp=3.14*(dp/2)*(dp/2)*p0; Fs=ks*x; F=(FD-Fs-Ff1-Ff2-Fp); prop[SDOF_LOAD_F_X]= F; } else { prop[SDOF_ZERO_TRANS_X]=TRUE; } Message("\n 2d : Updated 6DOF prop with time = %f, distance = %f\n", time,x); Message("\n 2d : new location = %g", DT_CG(dt)[0]); Message("\n 2d : Force on Piston = %f, p0 = %f\n, po = %f\n", F,p0,po); end_f_loop(f,t) } |
|
Tags |
dynamic mesh, parallel processing, sdof |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Reconstruction of the parallel case with dynamic mesh | makaveli_lcf | OpenFOAM Post-Processing | 8 | December 3, 2024 12:16 |
Dynamic mesh in parallel udf | rsarma | Fluent UDF and Scheme Programming | 3 | August 2, 2018 08:02 |
Interesting problem: Parallel Processor VOF Fluent + Dynamic Mesh + System Coupling | spaceprop | FLUENT | 5 | September 2, 2014 10:43 |
[blockMesh] is parallel processing available for mesh generation? | sachinlb | OpenFOAM Meshing & Mesh Conversion | 4 | August 18, 2012 05:11 |
Dynamic Mesh moving interface help | akash.iitb | FLUENT | 0 | August 24, 2010 00:53 |