CFD Online Logo CFD Online URL
Home > Forums > General Forums > CFD Freelancers

WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF

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

LinkBack Thread Tools Search this Thread Display Modes
Old   January 18, 2015, 09:42
Default WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF
acasas's Avatar
Antonio Casas
Join Date: May 2013
Location: world
Posts: 85
Rep Power: 11
acasas is on a distinguished road

I need to generate a small udf code to apply forces and moment over a body C.G. that travels with initial velocity conditions. Itīs a transient, VOF, 6 DOF, dynamic mesh type problem (all this settings are already established) . This forces will change its direction in time depending on C.G. rotation. Body mass, moments of inertia, force magnitude and other details needed will be provided. I'm willing to pay 50 $.
Itīs a box with some thickness and some material. Itīs CG its at 0,0,0 and I use symmetry respect the xy plane. The properties then are described in the following UDF

#include "udf.h"

DEFINE_SDOF_PROPERTIES(test_box, prop, dt, time, dtime)
prop[SDOF_MASS] = 471;
prop[SDOF_IXX] = 130.83;
prop[SDOF_IYY] = 130.83;
prop[SDOF_IZZ] = 130.83;
prop[SDOF_SYMMETRY_X] = 0;
prop[SDOF_SYMMETRY_Y] = 0;
prop[SDOF_SYMMETRY_Z] = 1;

printf ("\n2d_test_box: Updated 6DOF properties");

I just need to include a moment and force with some magnitude, that of course will change due to the rotation of the body due to the external pressure from the flow. You can use for example a 1.5 Newtons in the x direction. Since this box is 1x1x1 m and I apply this force over one point , lets say at x=0.5, y=-0.5 and z=0, then over the cg, there will be a force and a moment. the force will be 1.5 N and the moment will be Mz=-1.5x0.5=-0.75 Mm .

here there is an example of what I believe should be something very similar, but I donīt know anything about udf so Iīm not sure how this guy included the values and where. So I canīt trak the variables and I donīt know where to include them in thsi example

Below I attach info relevant on what I believe its necessary for this type of UDF which I don't have experience and programming knowledge.

thankīs a lot

You can use DEFINE SDOF PROPERTIES to specify custom properties of moving objects for
the six-degrees of freedom (SDOF) solver in FLUENT. These include mass, moment and
products of inertia, and external forces and moment properties. The properties of an object
which can consist of multiple zones can change in time, if desired. External load forces
and moments can either be specified as global coordinates or body coordinates. In addition,
you can specify custom transformation matrices using DEFINE SDOF PROPERTIES.
DEFINE SDOF PROPERTIES(name,properties,dt,time,dtime)
Argument Type Description
symbol name UDF name.
real *properties Pointer to the array that stores the SDOF properties.
Dynamic Thread *dt Pointer to structure that stores the dynamic mesh
attributes that you have specified (or that are calculated
real time Current time.
real dtime Time step.
Function returns
There are four arguments to DEFINE SDOF PROPERTIES: name, properties, dt, and
dtime. You provide the name of the UDF. properties, dt, and dtime are variables
that are passed by the FLUENT solver to your UDF. The property array pointer that
is passed to your function allows you to specify values for any of the following SDOF
SDOF_MASS /* mass */
SDOF_IXX, /* moment of inertia */
SDOF_IYY, /* moment of inertia */
SDOF_IZZ, /* moment of inertia */
SDOF_IXY, /* product of inertia */
SDOF_IXZ, /* product of inertia */
SDOF_IYZ, /* product of inertia */
SDOF_LOAD_LOCAL, /* boolean */
SDOF_LOAD_F_X, /* external force */
SDOF_LOAD_F_Y, /* external force */
SDOF_LOAD_F_Z, /* external force */
SDOF_LOAD_M_X, /* external moment */
SDOF_LOAD_M_Y, /* external moment */
SDOF_LOAD_M_Z, /* external moment */
The boolean prop[SDOF LOAD LOCAL] can be used to determine whether the forces and
moments are expressed in terms of global coordinates (FALSE) or body coordinates (TRUE).
The default value for prop[SDOF LOAD LOCAL] is FALSE.
Custom Transformation Variables
The default transformations used by FLUENT are typical for most aerospace and other
types of applications. However, if your model requires custom transformations, you can
specify these matrices in your SDOF UDF. First set the SDOF CUSTOM TRANS boolean
to TRUE. Then use the macros listed below to define custom coordination rotation and
derivative rotation matrices. CTRANS is the body-global coordinate rotation matrix and
DTRANS is the body-global derivative rotation matrix.
SDOF_CUSTOM_TRANS, /* boolean */
SDOF_CTRANS_11, /* coordinate rotation matrices */
SDOF_DTRANS_11, /* derivative rotation matrices */

Example 1
The following UDF, named stage, is a simple example of setting mass and moments of
inertia properties for a moving object. This UDF is typical for applications in which a
body is dropped and the SDOF solver computes the body’s motion in the flow field.
/************************************************** **********
Simple example of a SDOF property UDF for a moving body
************************************************** ************/
#include "udf.h"
DEFINE_SDOF_PROPERTIES(stage, prop, dt, time, dtime)
prop[SDOF_MASS] = 800.0;
prop[SDOF_IXX] = 200.0;
prop[SDOF_IYY] = 100.0;
prop[SDOF_IZZ] = 100.0;
printf ("\nstage: updated 6DOF properties");
Example 2
The following UDF named delta missile specifies case injector forces and moments
that are time-dependent. Specifically, the external forces and moments depend on the
current angular orientation of the moving object. Note that this UDF must be executed
as a compiled UDF.
/************************************************** *****
SDOF property compiled UDF with external forces/moments
************************************************** *****/
#include "udf.h"
DEFINE_SDOF_PROPERTIES(delta_missile, prop, dt, time, dtime)
prop[SDOF_MASS] = 907.185;
prop[SDOF_IXX] = 27.116;
prop[SDOF_IYY] = 488.094;
prop[SDOF_IZZ] = 488.094;
/* add injector forces, moments */
register real dfront = fabs (DT_CG (dt)[2] -
(0.179832*DT_THETA (dt)[1]));
register real dback = fabs (DT_CG (dt)[2] +
(0.329184*DT_THETA (dt)[1]));
if (dfront <= 0.100584)
prop[SDOF_LOAD_F_Z] = 10676.0;
prop[SDOF_LOAD_M_Y] = -1920.0;
if (dback <= 0.100584)
prop[SDOF_LOAD_F_Z] += 42703.0;
prop[SDOF_LOAD_M_Y] += 14057.0;
printf ("\ndelta_missile: updated 6DOF properties");

Last edited by acasas; January 19, 2015 at 13:25.
acasas is offline   Reply With Quote

Old   January 23, 2015, 07:26
Mehul Patel - CFD Expert
Join Date: Jul 2013
Location: Ahmedabad
Posts: 41
Rep Power: 10
Mehul Patel is on a distinguished road

We have executed various CFD projects for worldwide clients.

You can send your requirements at or visit
HiTech CFD - CFD Analysis Services Provider.
Mehul Patel is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
6dof model - floating body flinde FLUENT 13 March 6, 2021 14:32
How to input external moment in 6dof in function W.r. t C-G location of the body? anbu2cfd Fluent UDF and Scheme Programming 1 March 30, 2016 13:50
apply body force udf to just one injection rima_se2003 Fluent UDF and Scheme Programming 0 December 31, 2014 17:00
to separate pressure force and viscous force using udf ignayars Fluent UDF and Scheme Programming 1 October 19, 2014 07:26
how to add body force in a duct jane FLUENT 0 March 27, 2004 23:13

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