CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   6DOF angular acceleration (https://www.cfd-online.com/Forums/fluent-udf/173627-6dof-angular-acceleration.html)

flo90000 June 23, 2016 10:41

6DOF angular acceleration
 
Hello

I want to simulate the movement of a valve with the 6DOF solver. This is my code:

Code:

#include "udf.h"
#include "math.h"
DEFINE_SDOF_PROPERTIES(Clapet, prop, dt, time, dtime)
{
        prop[SDOF_MASS]=1.067e-7;
        prop[SDOF_IZZ]=5.33e-11;
        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]=FALSE;
        prop[SDOF_LOAD_M_Z]=-9.81*0.0108*sin(DT_THETA(dt)[2])*0.0108;
        Message("\n 2d : Updated 6DOF properties DT_THETA_Z:%e, Mz:%e, Mass%e\n", DT_THETA(dt)[2], prop[SDOF_LOAD_M_Z], prop [SDOF_MASS]);
}


Code:

#include "udf.h"
DEFINE_SOURCE(xmom_source,c,t,dS,eqn)
{
        static real pos[ND_ND];
        static real con, source, x, y;
        static real X_MIN, X_MAX, Y_MIN, Y_MAX, C2;
        static int i;
        static Domain *domain;
        C_CENTROID(pos,c,t);
        x=pos[0];
        y=pos[1];
        X_MIN=1e-3;
        X_MAX=1.16e-3;
        Y_MIN=11e-3;
        Y_MAX=0.01082;
        C2=50000.0;
        i=0;
        if(x>X_MIN) i++;
        if(x<X_MAX) i++;
        if(y>Y_MIN) i++;
        if(y<Y_MAX) i++;
        if(i==4)
        {
                con=C2*0.5*C_R(c,t);
                source=-con*fabs(C_U(c,t))*C_U(c,t);
                dS[eqn]=-2.0*con*fabs(C_U(c,t));
        }
        else
        {
                source=0.0;
        }
        C_UDMI(c,t,0)=source;
        return source;
}
DEFINE_SOURCE(ymom_source,c,t,dS,eqn)
{
        static real pos[ND_ND];
        static real con, source, x, y;
        static real X_MIN, X_MAX, Y_MIN, Y_MAX, C2;
        static int i;
        static Domain *domain;
        C_CENTROID(pos,c,t);
        x=pos[0];
        y=pos[1];
        X_MIN=1e-3;
        X_MAX=1.16e-3;
        Y_MIN=0.01082;
        Y_MAX=0.011;
        C2=50000.0;
        i=0;
        if(x>X_MIN)i++;
        if(x<X_MAX)i++;
        if(y>Y_MIN)i++;
        if(y<Y_MAX)i++;
        if(i==4)
        {
                con=C2*0.5*C_R(c,t);
                source=-con*fabs(C_V(c,t))*C_V(c,t);
                dS[eqn]=-2.0*con*fabs(C_V(c,t));
        }
        else
        {
                source=0.0;
        }
        C_UDMI(c,t,0)=source;
        return source;
}

I add enough UDM location and don't have some problems during the compilation. And I have this error:

Quote:

Info: 6DOF: can't compute angular acceleration.
Check moments/products of inertia.
Updating mesh at time level N...
Warning: multiple subdivision required on zone 8. Subdivide using Constant Ratio.
Error: received a fatal signal (Segmentation fault).
After some research I found this solution to decrease the limit of moments of inertia but it doesn't work

Quote:

(rpsetvar 'dynamesh/sdof/minimum-cutoff-moments 1e-50)
http://www.cfd-online.com/Forums/flu...eleration.html

So I want to know if there are other possibilities and which or/and where is my fault

Thanks for your help

destroy April 29, 2019 10:54

Hey, did you solve your problem?


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