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

Two drops coalescing on substrate not conserving volume

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By ktayna

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 4, 2022, 14:19
Default Two drops coalescing on substrate not conserving volume
  #1
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 9
joshmccraney is on a distinguished road
Hi All

Can you help with the following issue?

Version: OpenFOAM 6 on Ubuntu 18.04 interFoam
Simulation: two water drops on a substrate coalescing
Issue: the drops are falling right through the substrate (-z direction). What am I missing?

My blockMesh is here
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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 0.01; // cm --> m

xmin -4;
xmax 5;
ymin -3;
ymax 3;
zmin 0;
zmax 3.5;

xcells 180;
ycells 120;
zcells 70;

vertices
(
    ($xmin $ymin $zmin)
    ($xmax $ymin $zmin)
    ($xmax $ymax $zmin)
    ($xmin $ymax $zmin)
    ($xmin $ymin $zmax)
    ($xmax $ymin $zmax)
    ($xmax $ymax $zmax)
    ($xmin $ymax $zmax)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) ($xcells $ycells $zcells) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    base
    {
        type wall;
        faces
        (
	    (1 5 4 0)
        );
    }

    openBoundaries
    {
        type patch;
        faces
        (
            (0 4 7 3)
            (3 7 6 2)
            (2 6 5 1)
            (4 5 6 7)
            (0 3 2 1)
        );
    }
);

// ************************************************************************* //
alpha.water.orig is here

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    base
    {
        type           constantAlphaContactAngle;
        theta0         106;
        limit          gradient;
        value          uniform 0;
    }

    openBoundaries
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }
}

// ************************************************************************* //
p_rgh is here

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
    base
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }

    openBoundaries
    {
        type            totalPressure;
        p0              uniform 0;
    }
}

// ************************************************************************* //
U is here

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (0 0 0);

boundaryField
{
    base
    {
        type            noSlip;
    }
    openBoundaries
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }
}


// ************************************************************************* //
I'm happy to supply any other relevant info. Thank you so much.

Last edited by joshmccraney; February 4, 2022 at 15:30.
joshmccraney is offline   Reply With Quote

Old   February 4, 2022, 15:45
Default
  #2
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 9
joshmccraney is on a distinguished road
Nevermind I'm an idiot. Was setting the wrong plane as the wall in blockMeshDict. Please ignore
joshmccraney is offline   Reply With Quote

Old   January 23, 2024, 10:30
Default
  #3
New Member
 
Késsia Tayná Silva
Join Date: Jan 2024
Posts: 4
Rep Power: 2
ktayna is on a distinguished road
Hello joshmckraney! Even though this post is from long ago, would you please help me on how to simulate two droplets using OpenFOAM? Currently I'm able to simulate one droplet with setFields and setAlphaField, but not two. Thank you beforehand!
ktayna is offline   Reply With Quote

Old   January 23, 2024, 11:15
Default
  #4
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 9
joshmccraney is on a distinguished road
Quote:
Originally Posted by ktayna View Post
Hello joshmckraney! Even though this post is from long ago, would you please help me on how to simulate two droplets using OpenFOAM? Currently I'm able to simulate one droplet with setFields and setAlphaField, but not two. Thank you beforehand!
What does you setFields file look like? Can you post it here? All you should have to do is copy the block of code you use for the first drop for the second (change drop center and radius if you want, of course)
joshmccraney is offline   Reply With Quote

Old   January 23, 2024, 13:41
Default
  #5
New Member
 
Késsia Tayná Silva
Join Date: Jan 2024
Posts: 4
Rep Power: 2
ktayna is on a distinguished road
Quote:
Originally Posted by joshmccraney View Post
What does you setFields file look like? Can you post it here? All you should have to do is copy the block of code you use for the first drop for the second (change drop center and radius if you want, of course)
Hello Josh! Here is my setFields and my setAlphaField. My setFields is working alright, I think the problem lies on my setAlphaField; it only builds the alpha field for the second droplet when there are two droplets specified in it.

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

defaultFieldValues
(
volScalarFieldValue alpha.phase1 0
);

regions
(
// Droplet 1
cylinderToCell
{
p1 (0.5 0.5 -1);
p2 (0.5 0.5 1);
radius 0.1;
fieldValues
(
volScalarFieldValue alpha.phase1 1
);
}

// Droplet 2
cylinderToCell
{
p1 (1.5 0.5 -1);
p2 (1.5 0.5 1);
radius 0.1;
fieldValues
(
volScalarFieldValue alpha.phase1 1
);
}
);


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

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

field alpha.phase1;
type cylinder;
radius 0.1;
direction (0 0 1);
origin (0.5 0.5 0);

field alpha.phase1;
type cylinder;
radius 0.1;
direction (0 0 1);
origin (1.5 0.5 0);

// ************************************************** *********************** //
ktayna is offline   Reply With Quote

Old   January 23, 2024, 14:15
Default
  #6
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 9
joshmccraney is on a distinguished road
Quote:
Originally Posted by ktayna View Post
Hello Josh! Here is my setFields and my setAlphaField. My setFields is working alright, I think the problem lies on my setAlphaField; it only builds the alpha field for the second droplet when there are two droplets specified in it.

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

defaultFieldValues
(
volScalarFieldValue alpha.phase1 0
);

regions
(
// Droplet 1
cylinderToCell
{
p1 (0.5 0.5 -1);
p2 (0.5 0.5 1);
radius 0.1;
fieldValues
(
volScalarFieldValue alpha.phase1 1
);
}

// Droplet 2
cylinderToCell
{
p1 (1.5 0.5 -1);
p2 (1.5 0.5 1);
radius 0.1;
fieldValues
(
volScalarFieldValue alpha.phase1 1
);
}
);


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

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

field alpha.phase1;
type cylinder;
radius 0.1;
direction (0 0 1);
origin (0.5 0.5 0);

field alpha.phase1;
type cylinder;
radius 0.1;
direction (0 0 1);
origin (1.5 0.5 0);

// ************************************************** *********************** //
Right, sorry it’s been a few years since I’ve used OF (have since graduated). So you’ll want to run setFields command twice. Once for first drop and once for second drop. For the second drop just comment out all of the commands you use for the first drop. Make sense?
joshmccraney is offline   Reply With Quote

Old   January 23, 2024, 15:56
Default
  #7
New Member
 
Késsia Tayná Silva
Join Date: Jan 2024
Posts: 4
Rep Power: 2
ktayna is on a distinguished road
Quote:
Originally Posted by joshmccraney View Post
Right, sorry it’s been a few years since I’ve used OF (have since graduated). So you’ll want to run setFields command twice. Once for first drop and once for second drop. For the second drop just comment out all of the commands you use for the first drop. Make sense?
You mean, the setAlphaField command? The setFields command works alright.

I'll try that and come back to report. Thank you!
ktayna is offline   Reply With Quote

Old   March 12, 2024, 15:36
Default
  #8
New Member
 
Késsia Tayná Silva
Join Date: Jan 2024
Posts: 4
Rep Power: 2
ktayna is on a distinguished road
Hello! I have solved my issue, so I want to put it here in case someone else ever find this problem. Running the command twice didn't work: when I ran the second time, the first droplet would be erased, as if it was the first time the command was ran. Ultimately, I stopped using "setAlphaField" and it works just fine using only the "setFields" command. I am not sure why it didn't work before, and I'm not sure why it is working now, but it is! Thank you
joshmccraney likes this.
ktayna is offline   Reply With Quote

Old   March 12, 2024, 17:17
Default
  #9
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 9
joshmccraney is on a distinguished road
Quote:
Originally Posted by ktayna View Post
Hello! I have solved my issue, so I want to put it here in case someone else ever find this problem. Running the command twice didn't work: when I ran the second time, the first droplet would be erased, as if it was the first time the command was ran. Ultimately, I stopped using "setAlphaField" and it works just fine using only the "setFields" command. I am not sure why it didn't work before, and I'm not sure why it is working now, but it is! Thank you
Sorry, didn’t see your second reply. And think I was thinking of funkSetFields, which I think would run twice when you want to add a phase. But makes sense, should only need to run setFields once. Nice job
joshmccraney is offline   Reply With Quote

Reply

Tags
interfoam, volume leaving

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
SU2 7.0.7 Built on CentOS 7, parallel computation pyscript mpi exit error? EternalSeekerX SU2 3 October 9, 2020 18:28
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 09:42
[GAMBIT] Meshing T-pipe maxpoint ANSYS Meshing & Geometry 19 November 25, 2016 01:33
multiphaseEulerFoam (OF2.3.0) : Courant number explodes when running in parallel Mehrez OpenFOAM Running, Solving & CFD 10 May 18, 2016 11:44
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 06:20


All times are GMT -4. The time now is 06:35.