CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

FOAM error "Could not find rho" in 6dof case

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 22, 2016, 09:52
Default FOAM error "Could not find rho" in 6dof case
  #1
Member
 
Eduardo Firvida
Join Date: Dec 2010
Posts: 36
Rep Power: 8
efirvida is on a distinguished road
Hi im trying to convert the propeller example into a 6dof case, to see how the fluid move the propeller. I just change the dynamicMeshDict as show below, but when I run the simulation always throws --> FOAM FATAL ERROR: Could not find rho. An I dont know where to put the rho value. because I dont see it on any example of 6dof.
Im using Openfoam 4.1 here is my case file modified:

dynamicMeshDict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh      dynamicMotionSolverFvMesh;

motionSolverLibs ("libsixDoFRigidBodyMotion.so");

solver            sixDoFRigidBodyMotion;

sixDoFRigidBodyMotionCoeffs
{
    patches         ("propeller.*");
    innerDistance   0.3;
    outerDistance   1;

    mass            1.6;
    centreOfMass    (0 0 0);
    momentOfInertia (0.5 0.5 0.5);
    orientation
    (
        1 0 0
        0 1 0
        0 0 1
    );
    angularMomentum (0 0 0);
    g               (0 0 -9.81);
    rhoName         rhoInf;
    rhoInf          1;
    report          on;

    solver
    {
        type symplectic;
    }

    constraints
    {
        yAxis
        {
            sixDoFRigidBodyMotionConstraint axis;
            axis                (0 1 0);
        }
        center
        {
            sixDoFRigidBodyMotionConstraint point;
            axis                (0 0 0);
        }
    }

    restraints
    {

    }
}


// ************************************************************************* //

pointDisplacement
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       pointVectorField;
    location    "0.01";
    object      pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 0 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    "propeller.*"
    {
        type            calculated;
        value           uniform (0 0 0);
    }

    ".*"
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
}


// ************************************************************************* //
controlDict
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     pimpleDyMFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         5.0;

deltaT          1e-5;
writeControl    adjustableRunTime;
writeInterval   0.001;

////- For testing with moveDynamicMesh
//deltaT          0.01;
//writeControl    timeStep;
//writeInterval   1;

purgeWrite      0;

writeFormat     binary;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

adjustTimeStep  yes;

maxCo           2;
/*
functions
{
    #includeFunc Q
    #include "surfaces"
    #include "forces"
}
*/
// ************************************************************************* //
efirvida is offline   Reply With Quote

Old   November 22, 2016, 12:25
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,829
Blog Entries: 6
Rep Power: 32
Tobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
I had to smile about your thread because two threads below yours there is the same question and I solved it yesterday already. I refer you to the solution -> http://www.cfd-online.com/Forums/ope...tml#post626241

Just as a suggestion:

  • Read the error message (cannot find rho -> so FOAM already tells you what is missing)
  • Use the search engine of this forum
  • Check out the tutorial cases in FOAM-4.x
  • If you are familiar with the source code, use Doxygen
Good luck.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 22, 2016, 12:46
Default
  #3
Member
 
Eduardo Firvida
Join Date: Dec 2010
Posts: 36
Rep Power: 8
efirvida is on a distinguished road
Quote:
Originally Posted by Tobi View Post
I had to smile about your thread because two threads below yours there is the same question and I solved it yesterday already. I refer you to the solution -> http://www.cfd-online.com/Forums/ope...tml#post626241
What happens is that yesterday did not exist that question when I wrote mine, but it was only until today that I could put it. And after seeing the answer, I did not see how to delete my question. I already have the case running to see what happens.

I'm really not familiar with the doxygen use it once but I generate too much complicated documentation. I wrote my own script to extract what I needed from the headers of the .H code, but I have not had much time to review it. Here is my generate doc but only for the $FOAM_SRC folder I have to run it on the applications folder

many thanks anyway
efirvida is offline   Reply With Quote

Old   November 22, 2016, 21:52
Default
  #4
Member
 
bye bye my blue
Join Date: Sep 2016
Posts: 37
Rep Power: 1
bye bye my blue is an unknown quantity at this point
Quote:
Originally Posted by efirvida View Post
Hi im trying to convert the propeller example into a 6dof case, to see how the fluid move the propeller. I just change the dynamicMeshDict as show below, but when I run the simulation always throws --> FOAM FATAL ERROR: Could not find rho. An I dont know where to put the rho value. because I dont see it on any example of 6dof.
Im using Openfoam 4.1 here is my case file modified:

dynamicMeshDict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh      dynamicMotionSolverFvMesh;

motionSolverLibs ("libsixDoFRigidBodyMotion.so");

solver            sixDoFRigidBodyMotion;

sixDoFRigidBodyMotionCoeffs
{
    patches         ("propeller.*");
    innerDistance   0.3;
    outerDistance   1;

    mass            1.6;
    centreOfMass    (0 0 0);
    momentOfInertia (0.5 0.5 0.5);
    orientation
    (
        1 0 0
        0 1 0
        0 0 1
    );
    angularMomentum (0 0 0);
    g               (0 0 -9.81);
    rhoName         rhoInf;
    rhoInf          1;
    report          on;

    solver
    {
        type symplectic;
    }

    constraints
    {
        yAxis
        {
            sixDoFRigidBodyMotionConstraint axis;
            axis                (0 1 0);
        }
        center
        {
            sixDoFRigidBodyMotionConstraint point;
            axis                (0 0 0);
        }
    }

    restraints
    {

    }
}


// ************************************************************************* //

pointDisplacement
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       pointVectorField;
    location    "0.01";
    object      pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 0 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    "propeller.*"
    {
        type            calculated;
        value           uniform (0 0 0);
    }

    ".*"
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
}


// ************************************************************************* //
controlDict
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     pimpleDyMFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         5.0;

deltaT          1e-5;
writeControl    adjustableRunTime;
writeInterval   0.001;

////- For testing with moveDynamicMesh
//deltaT          0.01;
//writeControl    timeStep;
//writeInterval   1;

purgeWrite      0;

writeFormat     binary;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

adjustTimeStep  yes;

maxCo           2;
/*
functions
{
    #includeFunc Q
    #include "surfaces"
    #include "forces"
}
*/
// ************************************************************************* //
Instead of your "functions" in ContorlDict, use my script

functions

{

forces

{

type forces;

libs ( "libforces.so" );

writeControl timeStep;

writeInterval 10;

patches (walls);

rho rhoInf;

log true;

rhoInf 1;

CofR (0 0 0);

}

}
bye bye my blue is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CGNS converters available mbeaudoin OpenFOAM Meshing & Mesh Conversion 132 January 19, 2017 17:17
non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Native Meshers: blockMesh 7 April 17, 2013 05:42
CFX-Pre problem, pls help!!! cth_yao CFX 0 February 17, 2012 01:52
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 12:24


All times are GMT -4. The time now is 16:19.