C++代码 6DOF动网格UDF

#include "udf.h"

#define BMODULUS 2.2e9 
#define rho_ref 1000.0 
    
DEFINE_PROPERTY(water_density,c,t) 
{
    real rho; 
    real p, dp, p_operating; 
    
    p_operating = RP_Get_Real("operating-pressure"); 
    p=C_P(c,t); 
    dp=p-p_operating;
    rho = rho_ref/(1.0-dp/BMODULUS);

    return rho; 
}

DEFINE_PROPERTY(water_speed_of_sound,c,t) 
{
    real a; 
    real p, dp, p_operating; 

    p_operating = RP_Get_Real ("operating-pressure"); 
    p=C_P(c,t); 
    dp=p-p_operating; 
    a=(1.-dp/BMODULUS)*sqrt(BMODULUS/rho_ref); 
    
    return a;
}

DEFINE_SDOF_PROPERTIES(test_box, prop, dt, time, dtime) 
{
    prop[SDOF_MASS]=666.66; 
    prop[SDOF_IXX]=111.1111;
    prop[SDOF_IYY]=111.1111; 
    prop[SDOF_IZZ]=111.1111;
    
    printf ("\n2d_test_box: updated 6DOF properties");
}

你可能感兴趣的:(Cpp代码,前端,javascript,开发语言)