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

[isoAdvector] Correct isoAdvector/interIsoFoam/InterFoam BCs

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 3 Post By roenby
  • 1 Post By Fschi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 14, 2017, 09:30
Default Correct isoAdvector/interIsoFoam/InterFoam BCs
  #1
New Member
 
Join Date: Aug 2017
Posts: 10
Rep Power: 9
schf is on a distinguished road
Hello everyone,
hopefully someone can help me with the boundary conditions for the interIsoFoam - which should be the same as for interFoam...

In the picture you can see a simple testcase, where water is flowing through a box. But there must be some error in the BC which occurs, if there is a really small droplet at the bottom of the box.
Sometimes there is a single cell with really high pressure and a really high velocity and the simulation crashes...

My BCs are:
alpha.water
Code:
    inlet
    {
        type            zeroGradient;  
      
    }

    outlet
    {
        type            zeroGradient;  
    }

    bottom
    {
        type           dynamicAlphaContactAngle;
        theta0         80;
        thetaA         90;
        thetaR         50;
        uTheta         0.01;
        limit          zeroGradient;//gradient;
        value          uniform 0;
    }

    waterInlet
    {
        type            fixedValue;
    value        1;   
    }

    top
    {
        type            zeroGradient;
    }

    "front|back"
    {
        type           dynamicAlphaContactAngle;
        theta0         80;
        thetaA         90;
        thetaR         50;
        uTheta         0.01;
        limit          zeroGradient;//gradient;
        value          uniform 0;
    }
U:
Code:
    inlet
    {
        type            fixedValue;
        value           uniform (15 0 0);
    }
    outlet
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }
    bottom
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    top
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    waterInlet
    {
        type            fixedValue;
        value           uniform (0 0 0.02);
    }
    "front|back"
    {
        type            zeroGradient;
    }
and p_rgh:
Code:
    inlet
    {
        type            zeroGradient;
    }

    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }

    bottom
    {
        type            fixedFluxPressure; 
        value           uniform 0;
    adjoint        no;
    }
    
    waterInlet
    {
        type            fixedFluxPressure;
        value           uniform 0;
    adjoint        no;
    }

    top
    {
    type        zeroGradient;
    }

    "front|back"
    {
        type            fixedFluxPressure;
        value           uniform 0;
    adjoint        no;
    }
Does anybody can help me to get the correct boundary conditions?
Thanks in advance!
Attached Images
File Type: png 20171115_ErrorBC.png (57.1 KB, 182 views)
schf is offline   Reply With Quote

Old   November 29, 2017, 04:53
Default
  #2
Member
 
Johan Roenby
Join Date: May 2011
Location: Denmark
Posts: 93
Rep Power: 21
roenby will become famous soon enough
Hi schf

Try to send med the case including an Allrun script so I can see exactly what you are doing.

Please also let me know which version of OpenFOAM you are using.

Kind regards,
Johan.Roenby [at] gmail.com
roenby is offline   Reply With Quote

Old   November 30, 2017, 09:51
Default
  #3
New Member
 
F
Join Date: Jan 2017
Posts: 12
Rep Power: 9
Fschi is on a distinguished road
hello roenby,
see the attached case.

Steps to reproduce the problem with OpenFOAM-v1706:
./Allrun
run the simulation for ~0.025s. If you look at the residuals with pyFoam, you can see the problem starts at ~0.017s.
reconstruct the case
-> sometimes these high velocities occur. But not in each timeStep

My guess is, that it's a problem with the pressure equation. Due to the surface tension there is a high pressure inside the droplet and somehow this causes the problem.

Could this problem be linked with your outlook here at page 40?:
roenby.com/postdoc/wp.../01/OceanFOAM2016_Roenby.pdf

Did you have time to work on this inconsistency of the pressure handling? Or is it up to me or somebody else to fix it?

Best regards
FSchi
Attached Files
File Type: zip 20171130_TestCase.zip (17.4 KB, 14 views)
Fschi is offline   Reply With Quote

Old   November 30, 2017, 17:34
Default
  #4
Member
 
Johan Roenby
Join Date: May 2011
Location: Denmark
Posts: 93
Rep Power: 21
roenby will become famous soon enough
Hi schf/Fschi (Schilling?)

I had a look at your case. So you are simulating a 5 cm section of a 2 cm wide channel with a air flow of 16.67 m/s through it. At the bottom of the channel you have an orifice of diameter ~ 0.5 cm from which water is flowing up at around 3 cm/s. And you want to know how this water is blown with the wind down along the channel. Right?

I'd guess that a substantial fraction of the force that the air exerts on the water will be in terms of tangential shear stress along the interface. You should be aware that this shear stress is only properly calculated if you actually resolve the air and water boundary layers at the interface, which would require a VERY fine resolution.

Besides from that let me ask you a couple of questions:

Are you sure the problem with intermittent high velocities (I get U ~ 100 m/s in single cells) is related to your BC's? Why? Does it work with other BC's than the ones you listed?

Does the simulation run without problems with interFoam?

And if so, do you also get those ~1 cell size droplets running along the channel floor with interFoam? Are such droplets expected physically?

As stated elsewhere, the current surface tension implementation in interFoam is likely to dislike the sharper interface created by isoAdvector - especially with small and highly underresolved droplets as you get in your simulation (droplet diameter ~ dx ~ 0.2 mm). My guess would be that with interFoam and MULES, droplets of size ~dx released from the waterInlet will immediately dissolve into "numerical vapor". In that way the diffusivity of MULES helps you in terms of stability even though the numerically created vapor is not physical.

To verify that the intermittent very high velocities are caused by surface tension you could try to rerun with surface tension set to 0 in transportProperties.

I don't know if it will solve anything but by my experience it is also good practice to run with p_rghFinal tolerance 1 or 2 orders of magnitudes under surfCellTol. You currently run with p_rghFinal tolerance = 1e-6 and surfCellTol = 1e-8.

Also note that there is a patch for isoAdvector on https://develop.openfoam.com/ (commit ea173eea) correcting a small bug that sometimes led to crashes.

Here are some other things you could try:

What happens if you use PCG instead of GAMG for p_rgh and p_rghFinal instead of GAMG?

What happens if you use Euler instead of CrankNicolson 0.5 for ddtSchemes in fvSchemes?

It seems you are running with no-slip and no wall functions or any attempt to resolve boundary layers at sides and bottom. You could also try to run with slip here.

Kind regards,
Johan
amolrajan, sramac3 and Aabadani like this.
roenby is offline   Reply With Quote

Old   July 26, 2018, 10:52
Default
  #5
New Member
 
F
Join Date: Jan 2017
Posts: 12
Rep Power: 9
Fschi is on a distinguished road
correct and thanks for your help!


First I want to apologize for this (very) late response. I had to work on other things so I didn't have the time to investigate your ideas...


Yes you described the case correct. I don't know if it's interesting to you anymore, but here a short description of the results now (with the newest OpenFOAM-dev and isoAdvector):


- I don't get this high velocities anymore, so this problem seems to be solved
- I get very similar results with GAMG and PCG
- with surface tension set to 0 there are no spurious currents
- with surface tension there ist the problem of spurious currents (see attached images). These images are a top view of the water outlet and you can see the spurious currents forming.


maxAlphaCo = 0.2 and dx~0.125mm


As far as I understand this problem isn't solved yet. So if I change dx or dt they still could appear, correct?
Attached Images
File Type: png isoFaces.png (82.2 KB, 102 views)
File Type: png p_rgh.png (26.4 KB, 80 views)
Fschi is offline   Reply With Quote

Old   August 2, 2018, 05:21
Default
  #6
New Member
 
F
Join Date: Jan 2017
Posts: 12
Rep Power: 9
Fschi is on a distinguished road
Please ignore the last part of the last post. It's a problem of the dynamicAlphaContactAngle BC solved in OpenFoam 6 (https://bugs.openfoam.org/view.php?id=2864)

To get the expected behaviour the change from thetaA/thetaR to thetaAdv/thetaRec does the trick. If not, the receding contactAngle is higher than the advancing contactAngle...
roenby likes this.
Fschi is offline   Reply With Quote

Old   February 6, 2019, 11:09
Default
  #7
New Member
 
Max
Join Date: Feb 2017
Posts: 11
Rep Power: 9
xneop is on a distinguished road
Hi Fschi


please i need your assistance, the result of my simulation is the result pdf file, i do not know how to figure out what's wrong. i will add the others file y can have look on my settings. i used interFoam instead of interIsoFoam from openfoam-extend. please any suggestion is welcome





Best Regards
Attached Files
File Type: pdf result.pdf (90.7 KB, 42 views)
File Type: txt fvSolution.txt (1.6 KB, 14 views)
File Type: txt fvSchemes.txt (1.3 KB, 8 views)
File Type: txt controlDict.txt (1.3 KB, 4 views)
xneop 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
chtMultiRegionSimpleFoam: inconsistency between BCs and results Diro7 OpenFOAM Running, Solving & CFD 1 March 2, 2017 05:36
Interpolation Error on FAM Mesh with Cyclic BCs ngj OpenFOAM Bugs 1 August 9, 2011 07:12
strange turbulent BCs work marine OpenFOAM 3 June 14, 2010 09:41
The correct BCs for defining an "open room". suitup OpenFOAM 3 March 8, 2010 15:32
Wall BC's for a NS solver André Burdet Main CFD Forum 6 December 8, 2000 22:45


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