CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to move background mesh with body in overset mesh method? (https://www.cfd-online.com/Forums/openfoam-solving/228546-how-move-background-mesh-body-overset-mesh-method.html)

zkdkeen July 5, 2020 07:17

How to move background mesh with body in overset mesh method?
 
Hello everyone! I am trying to simulate a boat accelerating case with v1806 which contains overset mesh method. In the case, the accelerating phase is most concerned. The acceleration can be realized by rotating the propeller. However, because the boat moving distance is very long, to save grid I want to simulate the motion by making background mesh follow the boat in x-direction. So how to do that? :o

zkdkeen July 8, 2020 21:15

rigidBodyDynamics seems to be the entry.
 
As OpenFOAM uses the rigidBodyDynamics lib to handle multi-body motions within overset mesh, it seems that the rigidBodyDynamics needs to be modified.:)

I am currently working on it.

zkdkeen July 12, 2020 23:12

Background mesh movement is done!
 
4 Attachment(s)
I have successfully made the background mesh moving by adding a restraint in rigidBodyDynamics. From the flowing picture, we can see the background moving to the left.

An other question is rising, that is the inlet boundary condition. I used the condition same as the DTCHull tutorial. But the water is flowing away during the simulation. However, if i set the value from to 0 to 1 in the alpha.water file, there is a thin layer of water covering the whole inlet boundary cell, which is still not what I want.

So, how to set he water level at inlet boundary when moving the background mesh?

The following picture is the result of my 2D floating case.

benchwell July 13, 2020 11:24

Hi Antoni,


did you use the "setFields" command and "setFieldsDict", respectively? That should set separate the inlet faces between air (0) and water (1) in alpha.water.



Best regards

zkdkeen July 13, 2020 21:46

Hi Felix, thanks for your reply.

Yes, I used the setFields command in the preprocess, and the setFieldsDict is as follow:
Code:

defaultFieldValues
(
    volScalarFieldValue alpha.water 0
    volScalarFieldValue zoneID 123
);

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

    cellToCell
    {
        set c0;

        fieldValues
        (
            volScalarFieldValue zoneID 0
        );
    }
    cellToCell
    {
        set c1;

        fieldValues
        (
            volScalarFieldValue zoneID 1
        );
    }

);

When I changed the fixedValue to the variableHeightFlowRate at inlet for alpha.water, the case run.
alpha.water:
Code:


dimensions      [0 0 0 0 0 0 0];

internalField  uniform 0;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"

    inlet
    {
        //type            fixedValue;
        //value          uniform 0;
        type            variableHeightFlowRate;
        lowerBound      0;
        upperBound      1;
        value          $internalField;

    }

    outlet
    {
        type            variableHeightFlowRate;
        lowerBound      0;
        upperBound      1;
        value          $internalField;
    }


    stationaryWalls
    {
        type            zeroGradient;
    }
    atmosphere
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value          uniform 0;
    }
    floatingObject
    {
        type            zeroGradient;
    }
    bgFrontAndBack
    {
        type empty;
    }

    frontAndBack
    {
        type empty;
    }
}

And the p_rgh and U is as follow:
Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 -1 -2 0 0 0 0];

internalField  uniform 0;

boundaryField
{

    inlet
    {
        type            fixedFluxPressure;
        value          $internalField;
      //type            zeroGradient;
    }

    outlet
    {
        type            zeroGradient;
    }
    oversetPatch
    {
        type            overset;
    }
    stationaryWalls
    {
        type            fixedFluxPressure;
    }
    atmosphere
    {
        type            totalPressure;
        p0              uniform 0;
        U              U;
        phi            phi;
        rho            rho;
        psi            none;
        gamma          1;
        value          uniform 0;
    }
    floatingObject
    {
        type            fixedFluxPressure;
        value          $internalField;
    }
    overset
    {
        patchType      overset;
        type            fixedFluxPressure;
    }
    bgFrontAndBack
    {
        type empty;
    }

    frontAndBack
    {
        type empty;
    }
}

Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Umean 0;
mUmean 0;
dimensions      [0 1 -1 0 0 0 0];

internalField  uniform ($mUmean 0 0);

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"



    inlet
    {
        //type            pressureDirectedInletOutletVelocity;//freestreamVelocity;//fixedValue;
        //value          $internalField;
        //freestreamValue    (0 0 0);
        //inletDirection (1 0 0);
        //value          uniform  (0 0 0);

        type            fixedValue;
        value          $internalField;
       
       
    }

    outlet
    {
        //type            outletPhaseMeanVelocity;
        //alpha          alpha.water;
        //Umean          $Umean;
      // value          $internalField;
        type            pressureDirectedInletOutletVelocity;
        inletDirection (1 0 0);
        value          $internalField;// uniform  (0 0 0);


    }
    stationaryWalls
    {
        type          movingWallVelocity;// fixedValue;
        value          uniform (0 0 0);
    }
    atmosphere
    {
        type            pressureInletOutletVelocity;
        tangentialVelocity $internalField;
        value          uniform (0 0 0);
    }
    floatingObject
    {
        type            movingWallVelocity;
        value          uniform (0 0 0);
    }
    bgFrontAndBack
    {
        type empty;
    }

    frontAndBack
    {
        type empty;
    }
}

However, With more complicated meshes the simulation seemed to blow up. I suspect the combination of alpha.water, p_rgh and U is not stable.
Any ideas which combinations for p_rgh and U could work when fixing the inlet alpha.water level?
Hints are highly welcome!
Antoni

benchwell July 15, 2020 05:59

If a more complex mesh blows up the simulation, I'd assume that the mesh is responsible, not the boundary conditions.



Is the quality of the mesh acceptable? In particular with respect to overset, a suitable interpolation area must be given.

saeed.barzegar.v September 25, 2020 11:14

Hi Antoni,

Can you please share more detail on how you managed to get moving mesh as background mesh in the overset mesh method? I have a NWT with a moving paddle at the inlet (dynamic mesh), and I need to add a moving ship interacting with the incoming wave as well.

Thank you,
Saeed


Quote:

Originally Posted by zkdkeen (Post 777588)
I have successfully made the background mesh moving by adding a restraint in rigidBodyDynamics. From the flowing picture, we can see the background moving to the left.



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