CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

UDF for planetary motion

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By wyldckat
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 9, 2018, 02:08
Default UDF for planetary motion
  #1
New Member
 
Ansh
Join Date: Sep 2018
Posts: 3
Rep Power: 8
Ansh is on a distinguished road
Hello everyone, iam new to openfoam and for my project i need to describe planetary motion for two blades around one center blade. iam using overPimpleDyMFoam so can anyone point out the right direction to achieve this. Where and how to write UDF?
And how to link it with my present solver?
thanks
Ansh is offline   Reply With Quote

Old   October 13, 2018, 07:54
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Ansh and welcome to the forum,

No UDF should be necessary. Since you are likely using OpenfOAM-v1806, please study the respective OpenFOAM Tutorial Guide: https://www.openfoam.com/documentation/tutorial-guide/ - this will give you a better basis on how to get things to work.

Then once you are more familiar with how OpenFOAM works, check the tutorial case "tutorials/multiphase/overInterDyMFoam/boatAndPropeller/" and in the file "constant/dynamicMeshDict" you will start to see how the moving parts are defined...

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   October 15, 2018, 03:36
Default
  #3
New Member
 
Ansh
Join Date: Sep 2018
Posts: 3
Rep Power: 8
Ansh is on a distinguished road
thanks for quick reply, i have started looking into mentioned tutorials. after adjusting that dynamicmeshdict according to my need iam getting following error


--> FOAM FATAL ERROR:
Could not find rho:rho

From function void Foam::functionObjects::forces::initialise()
in file forces/forces.C at line 204.

FOAM exiting


i have found other threads related to this bug and i have changed my rhoName to rho as you mentioned there still iam getting this error. Any suggestions


function for force in controldict:


functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so");
writeControl timeStep;
writeInterval 5;
patches (hole1);
rho rhoInf;

rhoInf 1;
CofR (0 0 0);
p p;
U U;
log yes;
verbose true;
}
}
Ansh is offline   Reply With Quote

Old   October 20, 2018, 16:35
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: Details, details, details... I need details... Please check the following thread for more information on how to provide mode details: How to give enough info to get help

Because my best guess right now is that you've used the wrong command to start the simulation...
What I mean is that the "rho" field should exist when the solver starts running... so if it doesn't exist, then it might mean that you've tried using it with the wrong application.
Tobi likes this.
wyldckat is offline   Reply With Quote

Old   October 22, 2018, 02:17
Default overPimpleDymFoam rigid body motion rho not found
  #5
New Member
 
Ansh
Join Date: Sep 2018
Posts: 3
Rep Power: 8
Ansh is on a distinguished road
iam intending to use rigid body motion in overPimpleDyMFoam since i want to give planetary motion to the blades (fig is attached) mesh.jpg
where outer two blades will rotate and revolve arround the centre blade.


I have followed the overInterDyMFoam from multiphase flow to achieve that motion
iam attaching my conrolDict,forceCoeffs and dynamicMeshDict for reference



dynamicMeshDict


Code:
motionSolverLibs    ("librigidBodyMeshMotion.so");

dynamicFvMesh       dynamicOversetFvMesh;

//dynamicOversetFvMeshCoeffs
//{
//    layerRelax 0.3;
//}

motionSolver          rigidBodyMotion;

solver
    {
        type Newmark;
        gamma   0.1;    // Velocity integration coefficient
        beta    0.1;    // Position integration coefficient
    }

    accelerationRelaxation 1.0;

    //- prescribedRotation requires some sub-iterations to converge faster
    //  to desired value.
    nIter   3;

bodies
    {
        movingzone2
        {
            type            rigidBody;
            parent          root;

            // Cuboid mass -- very simple setup. For more complicated shapes
            // see utility surfaceInertia
            mass            9;
            rho             1;
            inertia         (0.05 0 0 0.05 0 0.05);
            centreOfMass    (0.21 -0.07 0); // relative to the centreOfMass
                                            // of parent body
                                            // (here root = global coord system)

            // Transformation tensor and centre of rotation
            transform       (1 0 0 0 1 0 0 0 1) (0.21 0 0);

            joint
            {
                type            composite;
                joints
                (
                    {
                        type Pxyz;  // Allow movement in any direction
                    }
                    {
                        type Rxyz;  // Allow rotation along any axis
                                    // (local - body CS)
                    }
                );
            }

            patches         (hole2);
            innerDistance   100;    // With overset we want to avoid the mesh
                                    // deformation so have large innerDistance
            outerDistance   200;
        } // end hull

        movingzone1
        {

            type            rigidBody;
            parent          movingzone2;

            centreOfMass    (-0.228 0.0 0);
            mass            1;
            rho             1;
            inertia         (0.001 0 0 0.001 0 0.001);
            transform       (1 0 0 0 1 0 0 0 1) (-0.228 0 0);
            patches        (hole1);
            innerDistance   100;
            outerDistance   200;
            joint
            {
                type            Rx;
            }
        } //end propeller

        movingzone3
        {
            type            rigidBody;
            parent          movingzone2;//root;
            centreOfMass    (-0.265 0 0);
            mass            1;
            rho             1;
            inertia         (0.001 0 0 0.001 0 0.001);
            transform       (1 0 0 0 1 0 0 0 1) (-0.265 0 0);
            patches        (hole3);
            innerDistance   100;
            outerDistance   200;
            joint
            {
                type            Ry;
            }
        }
         solid-background
        {
            type            rigidBody;
            parent          movingzone2;//root;
            centreOfMass    (-0.265 0 0);
            mass            1;
            rho             1;
            inertia         (0.001 0 0 0.001 0 0.001);
            transform       (1 0 0 0 1 0 0 0 1) (-0.265 0 0);
            patches        (hole3);
            innerDistance   100;
            outerDistance   200;
            joint
            {
                type            Ry;
            }
        }
    }

    restraints
    {
        movingzone1Rotation
        {
            type                    prescribedRotation;
            body                    movingzone1;
            referenceOrientation    (1 0 0 0 1 0 0 0 1);
            axis                    (0 1 0);    // Axis of rotation
            omega                   sine;       // Function1 entry
            omegaCoeffs
            {
                frequency   4;
                amplitude   0.2;
                scale       (0 1 0);
                level       (0 1 0);
            }
        }
        movingzone3Rotation
        {
            type                    prescribedRotation;
            body                    movingzone3;
            referenceOrientation    (1 0 0 0 1 0 0 0 1);
            axis                    (1 0 0);
            omega                   table
            (
                (0 (0 0 0))
                (1 (16 0 0))
            );
        }
     }
}



controlDict


Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

libs            ("liboverset.so" "librigidBodyDynamics.so");

application     overPimpleDyMFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         5;

deltaT          0.0000000025;

writeControl    adjustableRunTime;

writeInterval   0.005;

purgeWrite      0;

writeFormat     binary;

writePrecision  10;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

adjustTimeStep  yes;

//maxCo           1;
maxCo           5.0;
maxAlphaCo      5.0;
maxDeltaT       1;


functions
{
     #include "forceCoeffs"
}

forceCoeffs


Code:
forceCoeffs
{
    

    functionObjectLibs      ("libforces.so");

    writeControl    timeStep;
    timeInterval    1;

    patches         (walls);
    rho         rhoInf;      // Indicates incompressible
    rhoInf      1; 
    p           p;
    U           U;
    // Redundant for incompressible
    liftDir         (0 0 1);
    dragDir         (1 0 0);
    CofR            (0 0 0);  // Axle midpoint on ground
    pitchAxis       (0 1 0);
    magUInf         20;
    lRef            1.42;        // Wheelbase length
    Aref            0.75;        // Estimated
    /*
    binData
    {
        nBin        20;          // output data into 20 bins
        direction   (1 0 0);     // bin direction
        cumulative  yes;
    }
    */
}

and error that iam getting



Code:
Creating interpolatedCells field 

Selecting incompressible transport model Newtonian
Selecting turbulence model type laminar
Selecting laminar stress model Stokes
Reading/calculating face velocity Uf

No MRF models present

No finite volume options present
Courant Number mean: 0 max: 0

Starting time loop

Courant Number mean: 0 max: 0
deltaT = 2.9999994e-09
Time = 3e-09

forces forces:
    Not including porosity effects



--> FOAM FATAL ERROR: 
Could not find rho:rho

    From function void Foam::functionObjects::forces::initialise()
    in file forces/forces.C at line 204.

FOAM exiting





Quote:
What I mean is that the "rho" field should exist when the solver starts running... so if it doesn't exist, then it might mean that you've tried using it with the wrong application

1)does that mean i cannot use rigid body motion with overPimpleDyMFoam(since while using it only i have started facing this error )


2)can anyone recommend any literature available related to this?
pardon my immaturity with openfoam
Ansh is offline   Reply With Quote

Old   October 27, 2018, 14:14
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answers:

1. I've tested with OpenFOAM-v1806 as a Docker image. I used the tutorial case "incompressible/overPimpleDyMFoam/twoSimpleRotors" as a basis and did the modifications that you mentioned to the controlDict file, namely:
  1. Added the entry for "forceCoeffs" in the "functions"...
  2. And created the file "system/forceCoeffs", although I had to add this line in order for it to work:
    Code:
        type forceCoeffs;
    namely having the content of the file like this:
    Code:
    forceCoeffs
    {
    
        type forceCoeffs;
        functionObjectLibs      ("libforces.so");
    
        writeControl    timeStep;
        timeInterval    1;
    
        patches         (walls);
        rho         rhoInf;      // Indicates incompressible
        rhoInf      1;
        p           p;
        U           U;
        // Redundant for incompressible
        liftDir         (0 0 1);
        dragDir         (1 0 0);
        CofR            (0 0 0);  // Axle midpoint on ground
        pitchAxis       (0 1 0);
        magUInf         20;
        lRef            1.42;        // Wheelbase length
        Aref            0.75;        // Estimated
        /*
        binData
        {
            nBin        20;          // output data into 20 bins
            direction   (1 0 0);     // bin direction
            cumulative  yes;
        }
        */
    }
Then I run the solver and everything works just fine, namely it will make the calculations while it is simulating.


It also worked when I ran the solver with the "-postProcess" option, after I had a few time steps already written to disk:
Code:
overPimpleDyMFoam -postProcess

Mmmmm... this sounds like either a bug or some detail is missing for that type of rigid body motion... You may want to report this at http://develop.openfoam.com/ - although you may need to provide a simple test case, so that it's easier to reproduce the problem and fix it.




2. The documentation provided here: https://www.openfoam.com/documentation/ - should already have a considerable amount of information... check the "Extended Code Guide" page for more details, although it may be a bit confusing at first to navigate there.
Ansh likes this.
wyldckat is offline   Reply With Quote

Reply

Tags
openfoam, planetary mixer, udf


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
UDF CG motion Sam1990 Fluent UDF and Scheme Programming 1 May 9, 2017 17:22
Display Zone motion of a dynamic mesh????Checking my UDF motion Irenedea FLUENT 0 March 20, 2014 03:17
UDF to control motion NOT about CG LenDawg0220 Fluent UDF and Scheme Programming 0 July 28, 2012 13:54
UDF: DEFINE_CG_MOTION for vertical jump motion of an electrode! alban Fluent UDF and Scheme Programming 2 June 8, 2010 19:54
UDF error CG Motion Alex FLUENT 0 March 22, 2006 18:40


All times are GMT -4. The time now is 18:47.