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

Pressure divergence with floating object (interDyMFoam)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2021, 12:12
Default Pressure divergence with floating object (interDyMFoam)
  #1
New Member
 
Florian
Join Date: Apr 2021
Posts: 8
Rep Power: 5
FloB is on a distinguished road
Hello,

I want to simulate a floating object with interDyMFoam. For that, I based my files on the tutorial floatingObject (https://github.com/OpenFOAM/OpenFOAM...floatingObject)


I wanted to change the dimensions of the mesh and the floater, so I changed blockMeshDict, dynamicMeshDict, topoSetDict and setFieldsDict files only :

blockMeshDict:


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

scale 1;

X0    0;
X1     300;
Y0     0;
Y1     100;
Z0  0;
Z1     20;

nx  300;
ny  100;
nz  40;

vertices
(
    ($X0 $Y0 $Z0)
    ($X1 $Y0 $Z0)
    ($X1 $Y1 $Z0)
    ($X0 $Y1 $Z0)
    ($X0 $Y0 $Z1)
    ($X1 $Y0 $Z1)
    ($X1 $Y1 $Z1)
    ($X0 $Y1 $Z1)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) ($nx $ny $nz) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 4 7 3)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (2 6 5 1)
        );
    }
    stationaryWalls
    {
        type wall;
        faces
        (
            (0 3 2 1)
            (1 5 4 0)
            (3 7 6 2)
        );
    }
    atmosphere
    {
        type patch;
        faces
        (
            (4 5 6 7)
        );
    }
    floatingObject
    {
        type wall;
        faces ();
    }
);

mergePatchPairs
(
);

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

dynamicMeshDict:


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

dynamicFvMesh       dynamicMotionSolverFvMesh;

motionSolverLibs    ("libsixDoFRigidBodyMotion.so");

motionSolver        sixDoFRigidBodyMotion;

sixDoFRigidBodyMotionCoeffs
{
    patches         (floatingObject);
    innerDistance   0;
    outerDistance   4;

    centreOfMass    (150 50 10);

    // Cuboid dimensions
    Lx              80;
    Ly              30;
    Lz              6;

    // Density of the solid
    rhoSolid        500;

    // Cuboid mass
    mass            #calc "$rhoSolid*$Lx*$Ly*$Lz";

    // Cuboid moment of inertia about the centre of mass
    momentOfInertia #codeStream
    {
        codeInclude
        #{
            #include "diagTensor.H"
        #};

        code
        #{
            scalar sqrLx = $Lx*$Lx;
            scalar sqrLy = $Ly*$Ly;
            scalar sqrLz = $Lz*$Lz;
            os  <<
                $mass
               *diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/12.0;
        #};
    };

    rho	rhoInf;
    rhoInf	1000;
    report          on;
    accelerationRelaxation 0.95;
    accelerationDamping 0.95;
    solver
    {
        type Newmark;
//	type	symplectic;
//	type	CrankNicolson;
    }

    constraints
    {
        // fixedPoint
        // {
        //     sixDoFRigidBodyMotionConstraint point;
        //     centreOfRotation (0.5 0.45 0.1);
        // }

        fixedLine
        {
            sixDoFRigidBodyMotionConstraint line;
            centreOfRotation (150 50 10);
            direction (0 1 0);
        }

        fixedAxis
        {
            sixDoFRigidBodyMotionConstraint axis;
            axis (0 1 1);
        }

    }


}


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

topoSetDict:

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

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

actions
(
    {
        name    c0;
        type    cellSet;
        action  new;
        source  boxToCell;
        box (110 35 7) (190 65 13);
    }

    {
        name    c0;
        type    cellSet;
        action  invert;
    }
);


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


setFieldsDict:

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

defaultFieldValues
(
    volScalarFieldValue alpha.water 0
    volVectorFieldValue U (0 0 0)
//    volScalarFieldValue p_rgh 0
);

regions
(
    boxToCell
    {
        box (-100 -100 -100) (500 500 10);
        fieldValues ( volScalarFieldValue alpha.water 1 );
    }
);


// ************************************************************************* //
Note that I chose rhoSolid and submerged volume so that buyancy and weight forces are equal : as in my case there is not other forces, floater is supposed to be at equilibrium.


Unfortunately, with these new dimensions my simulation crashed after less than 1 s. I reduced time step to observe variables evolutions the first 1e-3/1e-2 s : I realized there was a pressure divergence. Indeed, pressure was oscillating between positive and negative value under the floater, and after a certain time values were so huge that simulation stoped.


I observed that there was no problem anymore when I reduced the X dimension of the floater (to have a shape closer to a square) and I absolutly don't know why.


However, I really wanted to simulate the shape I planed (80*30*6 m^3)
So I tried to change mesh dimension, mesh discretization, nCorrectors, nOuterCorrectors but it didn't work.

One thing helps me to solve my problem : change some fvScheme solvers :
I put Euler instead of CrankNicolson for ddtScheme and Gauss limitedLinearV 1 instead of Gauss vanLeerV for div(rhoPhi,U).
I do not know why it worked so if someone has an explanation I would be glade to read it.




Now, I'm facing again the same problem : I just wanted to suppress the constraints fixedLine and fixedAxis in dynamicMeshDict file and again, I get pressure oscillations and then divergence.
I tried to vary some parameters, without success... You'll find attached some screenshots just before the crash.


I also implemented the same model with potentialFreeSurfaceDyMFoam which is a bit similar to interDyMFoam, except there is only one phase (air is not represented). I get exactly the same problem of pressure divergence...


I would really appreciate to get some help from someone.

Thanks in advance,

Florian
Attached Images
File Type: jpg -1.jpg (44.3 KB, 27 views)
File Type: jpg 0.jpg (90.3 KB, 24 views)
File Type: jpg 1.jpg (91.3 KB, 24 views)
File Type: jpg 2.jpg (50.7 KB, 15 views)
File Type: jpg 3.jpg (46.6 KB, 11 views)
FloB is offline   Reply With Quote

Old   November 12, 2023, 09:46
Default
  #2
New Member
 
Kazakis Ioannis
Join Date: Sep 2016
Location: Thessaloniki, Greece
Posts: 24
Rep Power: 10
Giannis_Kaz is on a distinguished road
Dear Florian


I have exactly the same Problem. Any suggestions?


Regards
Giannis_Kaz 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
Wind tunnel Boundary Conditions in Fluent metmet FLUENT 6 October 30, 2019 13:23
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 04:23
Floating object with 6DoF in InterDyMFoam wavytracy OpenFOAM Programming & Development 2 November 5, 2010 11:28
Compilation error OF1.5-dev on Suse10.3 darenyang OpenFOAM Installation 0 April 29, 2009 05:55
Hydrostatic pressure in 2-phase flow modeling (long) DS & HB Main CFD Forum 0 January 8, 2000 16:00


All times are GMT -4. The time now is 13:57.