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

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2016, 08:52
Default FOAM error "Could not find rho" in 6dof case
  #1
Member
 
Eduardo Firvida
Join Date: Dec 2010
Posts: 53
Rep Power: 15
efirvida is on a distinguished road
Hi i´m 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 don´t know where to put the rho value. because I don´t see it on any example of 6dof.
I´m 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, 11:25
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi 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, 11:46
Default
  #3
Member
 
Eduardo Firvida
Join Date: Dec 2010
Posts: 53
Rep Power: 15
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, 20:52
Default
  #4
Member
 
bye bye my blue
Join Date: Sep 2016
Posts: 37
Rep Power: 8
bye bye my blue is an unknown quantity at this point
Quote:
Originally Posted by efirvida View Post
Hi i´m 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 don´t know where to put the rho value. because I don´t see it on any example of 6dof.
I´m 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

Old   August 21, 2017, 02:45
Default
  #5
New Member
 
Manideep Reddy
Join Date: Aug 2017
Posts: 7
Rep Power: 8
Manideep Reddy is on a distinguished road
Quote:
Originally Posted by bye bye my blue View Post
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);

}

}
Thank you very much
Manideep Reddy is offline   Reply With Quote

Reply


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
[CGNS] CGNS converters available mbeaudoin OpenFOAM Meshing & Mesh Conversion 137 December 14, 2018 04:20
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 05:42
CFX-Pre problem, pls help!!! cth_yao CFX 0 February 17, 2012 00:52
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 20: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 09:14.