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

Multiphase ramping functionality

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 2, 2019, 03:30
Default Multiphase ramping functionality
  #1
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
Hi all,

I just found out about the velocity ramping functionality for multi-phase flow that was recently added (https://github.com/OpenFOAM/OpenFOAM...b9f829e4ec3ec4). It looks extremely useful, so thanks for adding!

I'm not quite sure how to use it though; I tried adding it to the DTCHull tutorial in interFoam:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  dev
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      binary;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (-1.668 0 0);
velocityRamping
    {
        type        velocityRamping;
        active      on;
        selectionMode all;
        U           U;
        velocity    (-1.668 0 0);
        ramp
        {
            type        quarterSineRamp;
            start       0;
            duration    400;
        }
    }

boundaryField
{
    atmosphere
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }
    inlet
    {
        type            uniformFixedValue;
        uniformValue    scale;
        uniformValueCoeffs
        {
            scale           quarterSineRamp;
            scaleCoeffs
            {
                start           0;
                duration        400;
            }
            value           constant (-1.668 0 0);
        }
    }
    outlet
    {
        type            outletPhaseMeanVelocity;
        UnMean          1.668;
        ramp
        {
            type        quarterSineRamp;
            start        0;
            duration    400;
        }
        alpha           alpha.water;
    }
    bottom
    {
        type            symmetryPlane;
    }
    side
    {
        type            symmetryPlane;
    }
    midPlane
    {
        type            symmetryPlane;
    }
    hull
    {
        type            movingWallVelocity;
        value           uniform (0 0 0);
    }
}
As a reference, this is what 0/U originally looked like in this tutorial:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  dev
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      binary;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (-1.668 0 0);

boundaryField
{
    atmosphere
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }
    inlet
    {
        type            fixedValue;
        value           uniform (-1.668 0 0);
    }
    outlet
    {
        type            outletPhaseMeanVelocity;
        UnMean          constant 1.668;
        alpha           alpha.water;
        value           uniform (-1.668 0 0);
    }
    bottom
    {
        type            symmetryPlane;
    }
    side
    {
        type            symmetryPlane;
    }
    midPlane
    {
        type            symmetryPlane;
    }
    hull
    {
        type            movingWallVelocity;
        value           uniform (0 0 0);
    }
}
Clearly this wasn't the proper way to go about this; the simulation runs smoothly, but a spurious velocity patch shows up at t = 0, just below the free surface close to the inlet (see attached image, there's also one right behind the ship).

How should this new functionality be used exactly? Sorry if this is a silly/trivial question, but as this functionality is quite new, I couldn't find anything about it in the User Guide or elsewhere online, apart from the description on GitHub.

Thanks in advance,
Sita
Attached Images
File Type: jpg SpuriousVelocity_t0.jpg (20.4 KB, 63 views)
sita is offline   Reply With Quote

Old   May 13, 2019, 06:02
Default
  #2
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
Does anyone have experience with this new functionality?

Also, can it be used in combination with local time stepping (this is what the DTCHull tutorial uses)?

Many thanks,
Sita
sita is offline   Reply With Quote

Old   May 15, 2019, 03:50
Default
  #3
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
In case anyone else is struggling with this: I contacted one of the developers of this velocity ramping functionality, and he kindly provided the explanation below.


You need to define ramping function for the velocity at three points: inlet (BC type waveVelocity), outlet (BC type outletPhaseMeanVelocity) and you need the velocityRamping fvOption (which was recently renamed to accelerationSource). You need to ensure, that you have same parameters (ramp type, start and duration) for inlet, outlet and fvOption. Chose a reasonable value for ramp duration, e.g. for the DTC tutorial 25 seconds should be fine. For ramp type I normally use "quarterSineRamp". I hope this helps for getting your simulation running. If not, I can provide you example files for the DTCHull tutorial. One more hint: if you use a recent version of OpenFOAM-dev, you need to patch the waveSuperpostion.C file, because the current implementation does not support most of the ramp types. Unfortunately they changed implementation, which now uses intergration method of the function1, which is not implented for most function types. Remove "- UMean_->integrate(0, t)" in method transformation in waveSuperposition.C (line 68). Of course with this patch you will get wrong results, if waves are included.
sita is offline   Reply With Quote

Old   September 10, 2019, 16:46
Default
  #4
New Member
 
Bruno de Almeida Regina
Join Date: Jul 2019
Location: Brazil
Posts: 6
Rep Power: 7
Bruno_Kwothe is on a distinguished road
Hey there, Sita!

I am practically a newcomer to OpenFOAM and I find myself struggling with velocity ramps at this moment. This thread of yours really gave some light to the subject, but I still have a question: what to do with the internalField in ./0/U? How to set it?
Another thing that could be helpful: what other ramp types are there? Is linear ramp available?

I see you offered DTCHull tutorial with modified files... would you still be able to share them? I am interested

Anyhow, thanks in advance for the attention and sorry for any trouble.

Kind regards,
Bruno
Bruno_Kwothe is offline   Reply With Quote

Old   September 11, 2019, 03:46
Default
  #5
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
Hi Bruno,

To be honest I'm not much of an expert on this, if you really want to know how things work with velocity ramping, better contact one of the developers.

What seems to be working for me at the moment is something like the attached 0/U and constant/fvOptions files, although I'm still fine-tuning the required duration (too short causes huge waves to appear at the inlet and outlet). For a model-scale ship a few seconds is alright, but for a full-scale ship you clearly need longer.

I must admit I haven't tried using different ramp types yet. From a quick glance at the source files I gathered that there should be at least also a half cosine ramp. Have you tried the banana trick yet? That is, instead of quarterSineRamp, enter banana (or whatever other clearly incorrect word) in your dictionary files. OpenFOAM will then throw an error, and if you're lucky, it will list the valid ramp types. If not, rooting through the source files might help. Or just enter "linear", who knows, you might be lucky.

About the modified tutorial, that was one of the developers offering that, so if you think you need that, better contact one of the developers.

Hope this helps,
Sita
Attached Files
File Type: zip U_and_fvOptions.zip (1.2 KB, 56 views)
sita is offline   Reply With Quote

Old   September 17, 2019, 19:06
Default
  #6
New Member
 
Bruno de Almeida Regina
Join Date: Jul 2019
Location: Brazil
Posts: 6
Rep Power: 7
Bruno_Kwothe is on a distinguished road
Hi again, Sita!

Thank you for your files! I got caught up in other analyses and just now I am having time to test the ramp functionality.

I must confess, I was so excited with that previous message of yours that I did not realize it was the developer who offered the DTCHull files! But that's ok. Speaking of the developers, how did you contact them? Do you still have their contact?

Once again, thank you for the attention and sorry for the troubles!

Bruno
Bruno_Kwothe is offline   Reply With Quote

Old   September 18, 2019, 02:50
Default
  #7
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
Hi Bruno,

That's no problem. The names of the developers are in the GitHub post about the ramping functionality (https://github.com/OpenFOAM/OpenFOAM...b9f829e4ec3ec4), so I just Googled them. I'm a bit reluctant to share someone else's contact information here, but I'm sure you'll figure it out.

Best wishes,
Sita
sita is offline   Reply With Quote

Old   September 18, 2019, 14:03
Default
  #8
New Member
 
Bruno de Almeida Regina
Join Date: Jul 2019
Location: Brazil
Posts: 6
Rep Power: 7
Bruno_Kwothe is on a distinguished road
Okay, Sita!

Thank you for the tips!
Bruno_Kwothe 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
How to simulate the eulerian multiphase model about particle jhlee9622 STAR-CCM+ 2 November 24, 2016 12:37
The problem of Stiff Chemistry Solver in Multiphase model shenzhou1987 FLUENT 1 January 11, 2016 03:52
Multiphase Simulation - Fluent vinayak4399 Fluent Multiphase 3 December 13, 2015 12:46
Low Mach Number Compressible Multiphase Flows DarrenC CFX 10 May 26, 2014 09:52
transportProperties-syntax in 1.6 (ramping) utwaz OpenFOAM 0 November 20, 2009 12:41


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