CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   alphaContactAngle patch type does not work in OF-1.6 (http://www.cfd-online.com/Forums/openfoam-bugs/68592-alphacontactangle-patch-type-does-not-work-1-6-a.html)

sundaero September 24, 2009 20:14

alphaContactAngle patch type does not work in OF-1.6
 
Hello, everybody.

I found out that the new patch type alphaContactAngle which has replaced previously used constantGammaContactAngle for the interFoam solver does not work properly.

Consider given tutorial example damBreak using laminar turbulence model.

If you follow the User Guide and replace in the 0/alpha1 file any wall boundary patch from zeroGradient to something like:
Code:

boundaryField
{
    leftWall
    {
//        type            zeroGradient;
        type            alphaContactAngle;
        theta0          40;
        thetaA          70;
        thetaR          10;
        uTheta          1;
        value          uniform 1;
    }
...

then you will get the following error message:
Code:

damBreak> interFoam             
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.6                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 1.6-f802ff2d6c5a
Exec  : interFoam
Date  : Sep 25 2009
Time  : 02:56:41
Host  : kowalski
PID    : 18331
Case  : /home/semyonov/OpenFOAM/semyonov-1.6/run/damBreak
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


Reading g
Reading field p

Reading field alpha1

Reading field U

Reading/calculating face flux field phi

Reading transportProperties

Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian


Not Implemented
    Trying to construct an genericFvPatchField on patch leftWall of field rho#0  Foam::error::printStack(Foam::Ostream&) in "/home/semyonov/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#1  Foam::error::abort() in "/home/semyonov/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#2  Foam::genericFvPatchField<double>::genericFvPatchField(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&) in "/home/semyonov/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libfiniteVolume.so"
#3  Foam::fvPatchField<double>::addpatchConstructorToTable<Foam::genericFvPatchField<double> >::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&) in "/home/semyonov/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libfiniteVolume.so"
#4  Foam::fvPatchField<double>::New(Foam::word const&, Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&) in "/home/semyonov/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/interFoam"
#5  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::GeometricBoundaryField(Foam::fvBoundaryMesh const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::List<Foam::word> const&) in "/home/semyonov/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/interFoam"
#6  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::List<Foam::word> const&) in "/home/semyonov/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/interFoam"
#7  main in "/home/semyonov/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/interFoam"
#8  __libc_start_main in "/lib64/libc.so.6"
#9  _start at /usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/x86_64/elf/start.S:116


    From function genericFvPatchField<Type>::genericFvPatchField(const fvPatch& p, const DimensionedField<Type, volMesh>& iF)
    in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 45.

FOAM aborting

Aborted

Does that mean that this patch type is simply not yet implemented in OF-1.6?

Just in case I have also tried to set this patch to constantGammaContactAngle and alpha1ContactAngle, but neither works.

I am not very familiar with the source code. How can I check the list of the available and implemented boundary patche types?

Denis

henry September 25, 2009 04:04

alphaContactAngle is the abstract base-type with concrete implementations:

constantAlphaContactAngle
dynamicAlphaContactAngle
timeVaryingAlphaContactAngle

I think you need constantAlphaContactAngle for your case.

H

bfa September 25, 2009 04:51

different case, similar problem:

I tried to convert a OF 1.5-dev case with moving mesh to OF 1.6. First of all: Why is it that I now have to provide cellMotionU AND pointMotionU when using the velocityLaplacian motionSolver instead of just giving motionU as of version 1.5?
But the real problem is that I used the oscillatingFixedValue b.c. on a patch for movement, but that leads to
Code:

Not Implemented
    Trying to construct an genericFvPatchField on patch topStamp of field cellMotionU#0

As Henry mentioned, this b.c. might be a virtual one, but browsing the code shows me that it's not (it can be found in OpenFOAM-1.6/src/finiteVolume/fields/fvPatchFields/derived)

Any ideas how to use this or another b.c. that does the same job with a moving wall?

tx, bjoern

sundaero September 25, 2009 12:41

Thank you, Henry.

Suggestet patch types working well in the damBreak example of OF-1.6.

I guess it was just too late yesterday, so I forgot to simply replace constantGammaContactAngle with the constantAlphaContactAngle and thought that there is something wrong with OpenFOAM installation.

Denis

idrama December 8, 2009 04:40

Not yet figured out!
 
Hello sundaero!

Could you please post your final alpha1 file with the modified contact angle? Because I haven not yet figured out how it works.

Cheers,

Claus

sundaero December 8, 2009 10:14

Here it goes (implementation of the dynamic contact angle):
Code:

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

dimensions      [0 0 0 0 0 0 0];

internalField  uniform 1;

boundaryField
{
    FRONT_WALL
    {
        type            empty;
    }
    BACK_WALL
    {
        type            empty;
    }
    OUTLET
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value          uniform 0;
    }
    GAS_INLET
    {
        type            fixedValue;
        value          uniform 0;
    }
    CATALYST
    {
        type            dynamicAlphaContactAngle;
        theta0          40;
        thetaA          70;
        thetaR          10;
        uTheta          1;
        value          uniform 1;
    }
    LIQUID_INLET
    {
        type            zeroGradient;
        type            fixedValue;
        value          uniform 1;
    }
    TOP_WALLS
    {
        type            zeroGradient;
    }
    LEFT_RIGHT
    {
        type            cyclic;
        value          uniform 1;
    }
}


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

BR
Denis

markc June 16, 2010 11:11

Similar error, different cause
 
Hello All,

I have the similar error (Not implemented, trying to construct an gFPF on patch ... of field rho#()). The error is being generated by the file genericFvPatchField.C.
However, I am doing something else: I created a private boundary condition which is based on timeVaryingUniformFixedValue which is intended to be used on alpha1 field only. It compiles well. But at runtime I get that specific error.
My 0/alpha1 for that specific patch looks like

type surfaceWaveAlpha;
value uniform 0;

Because the error message is complaing about rho, I also tried adding : rho rho, without result.

Can anyone give me some hints here, althoug I admit that the description might be a bit vague...

Thanks in advance,

Mark

ajamy June 18, 2011 04:45

Hi, i am realy confused:(
whats the meaning of the 'thataA","theta0","thetaR" and "utheta"?
can you tell me a bout it briefly?
tnx

koooje March 19, 2012 23:23

Dear Henry,

I am a new user and I am trying to implement slug-plug flow of water in oil in a 250micon closed square channel. I have a relation which goes like thetaA=thetaA0+const*Ca^(1/3) for advancing CA and thetaR=thetaR0-const*Ca^(1/3) for receding CA, both based on Tanner's law. The difference in thetaA0 and thetaR0 is the contact angle hysteresis. I am trying to understand the shape of droplets under the influence of contact angle hysteresis. Could you please explain with a sample code, if possible how to implement dynamicAlphaContactAngle in /0/alpha1. I believe it goes into the boundary condition in alpha1. Your reply is deeply appreciated.

Thanks,

Koooje

koooje April 1, 2012 19:40

Go to : opt/openfoam210/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle for the implementation of dynamicAlphaContactAngle

Check out the file 'dynamicAlphaContactAngleFvPatchScalarField.C' and 'dynamicAlphaContactAngleFvPatchScalarField.H' to find the meaning of all the parameters you asked for. The theta is specified by the formula theta=theta0_ + (thetaA_ - thetaR_)*tanh(uwall/uTheta_). If you plot this formula with matlab/mathematica you can see how theta varies with different parameters.


Koooje

Nikhilcfd April 13, 2012 18:08

Hello Koooje,

To implement your new dynamic contact angle BC, start off by copying the existing files of dynamic contact angle implementation. You need to calculate the capillary number by creating volScalarField 'mu' in createField.H file and update it every iteration. Call the 'mu' from your new files and calculate the capillary number. Once you calculate that you can use your theta expressions. All you need to do is change the way theta is being calculated and return it to interface.C file which takes care of the correction. Hope this helps.

Nikhil


All times are GMT -4. The time now is 17:56.