CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Tutorial Hemida for OF-1.6 (https://www.cfd-online.com/Forums/openfoam/75524-tutorial-hemida-1-6-a.html)

flowris April 28, 2010 04:16

Tutorial Hemida for OF-1.6
 
Hello,


I am currently trying the InterFoam tutorial, written by Hassan Hemida, which can be found at http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2007/. I think this tutorial has been written for an older version of interFoam. The laminar case was easily runned, but for the RAS case, I needed to change quite a lot of the files. The files I downloaded were written for reasInterFoam, while in OpenFOAM-1.6, RAS simulation is integrated in the normal interFoam solver.

The case I set up was more or less a mixture between the original files from Mr. Hemida and the RAS damBreak tutorial.

When running the case, I received time step continuity errors in the first time step. My log file looks like this:


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
Selecting turbulence model type RASModel
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
sigmaEps 1.3;
}

time step continuity errors : sum local = 9.77995e-06, global = -9.77995e-06, cumulative = -9.77995e-06
DICPCG: Solving for pcorr, Initial residual = 1, Final residual = 7.62511e-09, No Iterations 178
DICPCG: Solving for pcorr, Initial residual = 4.89025e-10, Final residual = 4.89025e-10, No Iterations 0
time step continuity errors : sum local = 7.45727e-14, global = -9.41208e-16, cumulative = -9.77995e-06
Courant Number mean: 0.000122101 max: 0.0277845

Starting time loop

Courant Number mean: 0.000878914 max: 0.2
deltaT = 0.000719825
Time = 0.000719825

MULES: Solving for alpha1
Liquid phase volume fraction = 0.0220225 Min(alpha1) = 0 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.0220401 Min(alpha1) = 0 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.0220577 Min(alpha1) = 0 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.0220753 Min(alpha1) = 0 Max(alpha1) = 1
DICPCG: Solving for p, Initial residual = 1, Final residual = 0.00876324, No Iterations 94
DICPCG: Solving for p, Initial residual = 3.10228e-06, Final residual = 2.79213e-08, No Iterations 40
DICPCG: Solving for p, Initial residual = 0.000594512, Final residual = 5.7006e-06, No Iterations 92
DICPCG: Solving for p, Initial residual = 3.78488e-05, Final residual = 3.60187e-07, No Iterations 42
DICPCG: Solving for p, Initial residual = 0.00218362, Final residual = 1.99928e-05, No Iterations 86
DICPCG: Solving for p, Initial residual = 3.32376e-05, Final residual = 3.11412e-07, No Iterations 37
DICPCG: Solving for p, Initial residual = 0.00169515, Final residual = 1.46306e-05, No Iterations 82
DICPCG: Solving for p, Initial residual = 1.52903e-05, Final residual = 9.49297e-08, No Iterations 84
time step continuity errors : sum local = 2.1649e-09, global = 9.53018e-12, cumulative = -9.77994e-06



Can anyone help? (I am am not sure that I really understand what a time step continuity error means)

johnb April 28, 2010 07:07

Hi,

You will always see "time step continuity errors" during your simulations, ideally it should be zero. So as long as it it is small and not increasing during simulation everything is fine.

If it explodes you have either specified incorrect BC or your mesh quality might be poor.

Regards,
John

flowris April 29, 2010 03:41

complete log file
 
Thank you. I didn't give the complete log file, but it shows some more errors:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / 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 : Apr 29 2010
Time : 09:32:01
Host : rmawsynab105478
PID : 3037
Case : /home/jmatthei/OpenFOAM/jmatthei-1.6/run/tutorials_chalmers/turbFillBottleKEps_1
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
Selecting turbulence model type RASModel
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
sigmaEps 1.3;
}

time step continuity errors : sum local = 9.77995e-06, global = -9.77995e-06, cumulative = -9.77995e-06
DICPCG: Solving for pcorr, Initial residual = 1, Final residual = 7.62511e-09, No Iterations 178
DICPCG: Solving for pcorr, Initial residual = 4.89025e-10, Final residual = 4.89025e-10, No Iterations 0
time step continuity errors : sum local = 7.45727e-14, global = -9.41208e-16, cumulative = -9.77995e-06
Courant Number mean: 0.000122101 max: 0.0277845

Starting time loop

Courant Number mean: 0.000878914 max: 0.2
deltaT = 0.000719825
Time = 0.000719825

MULES: Solving for alpha1
Liquid phase volume fraction = 0.0220225 Min(alpha1) = 0 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.0220401 Min(alpha1) = 0 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.0220577 Min(alpha1) = 0 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.0220753 Min(alpha1) = 0 Max(alpha1) = 1
DICPCG: Solving for p, Initial residual = 1, Final residual = 0.00877667, No Iterations 94
DICPCG: Solving for p, Initial residual = 3.10704e-06, Final residual = 2.79188e-08, No Iterations 40
DICPCG: Solving for p, Initial residual = 0.000594512, Final residual = 5.62055e-06, No Iterations 92
DICPCG: Solving for p, Initial residual = 3.73173e-05, Final residual = 3.68162e-07, No Iterations 42
DICPCG: Solving for p, Initial residual = 0.00218363, Final residual = 1.99515e-05, No Iterations 86
DICPCG: Solving for p, Initial residual = 3.3169e-05, Final residual = 3.11278e-07, No Iterations 37
DICPCG: Solving for p, Initial residual = 0.00169515, Final residual = 1.46307e-05, No Iterations 82
DICPCG: Solving for p, Initial residual = 1.52904e-05, Final residual = 9.53714e-08, No Iterations 84
time step continuity errors : sum local = 2.17497e-09, global = 9.60109e-12, cumulative = -9.77994e-06
#0 Foam::error::printStack(Foam::Ostream&) in "/home/jmatthei/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/home/jmatthei/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 ?? in "/lib/libc.so.6"
#3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/home/jmatthei/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#4 void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/jmatthei/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libincompressibleTransportModels.so"
#5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/jmatthei/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libincompressibleRASModels.so"
#6 Foam::incompressible::RASModels::kEpsilon::correct () in "/home/jmatthei/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libincompressibleRASModels.so"
#7 main in "/home/jmatthei/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/interFoam"
#8 __libc_start_main in "/lib/libc.so.6"
#9 _start at /usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/x86_64/elf/start.S:116
Floating point exception

su_junwei April 29, 2010 04:49

Hi

It seems that you have set a zero value for k or epsilon on a certain boundary. Please try using a very small value instead.

Junwei

flowris May 3, 2010 05:19

small values for k and epsilon -> ok
 
Thanks Junwei,

I had values of 0.1 for k and epsilon in the internal field of timestep 0, but values zero on some of the boundaries. When I changed to values of 0.1 everywhere in timestep zero, my tutorial ran fine.

rlobosco May 28, 2010 13:21

2 Attachment(s)
I followed step by step of interFoam tutorial by Hassan Hemida. And applied exactly the same conditions to the geometry of a stepped spillway. But unreal oscillations appear at the interface, even more when I increase the length of the dam, as showed in the second picture attached. I realised that oscilations start from upper right coordenate of the box for defining alpha equal 1.
Can anyone give me a hint how to avoid this interface problem?
Someone tested this dambreak problem in 3D with geometry topology changes? The flow is also going from down the crest, it would stop to flow earlier.
Thanks for help.
With best regard,

flowris May 11, 2012 10:17

Oscillations on the air-water interface are a common problem using interFoam. Mesh refinement and good fvSchemes are the key to improve. Find more info here:
http://www.cfd-online.com/Forums/ope...ship-flow.html

vishal_s August 21, 2013 00:11

Hey flowris, I am also trying to simulate the InterFoam tutorial, written by Hassan Hemida, I have used the boundary conditions given below but unable to reproduce the same result as given in the tutorial for the laminar case (doing laminar case first). May you kindly look at the initial boundary conditions and let me know whether it is fine or not.

For U:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ 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
{
inlet
{
type fixedValue;
value uniform (0 -0.1 0);
}
inletWall
{
type fixedValue;
value uniform (0 0 0);
}
bottleWall
{
type fixedValue;
value uniform (0 0 0);
}
atmosphere
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
frontAndBack
{
type empty;
}
}


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

For P_rgh

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ 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
{
inlet
{
type zeroGradient;

}
inletWall
{
type zeroGradient;
}
bottleWall
{
type zeroGradient;

}

atmosphere
{
type totalPressure;
p0 uniform 0;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
value uniform 0;
}

frontAndBack
{
type empty;
}
}

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

For alpha1

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: 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 0;

boundaryField
{
inlet
{
type fixedValue;
value uniform 1;
}
inletWall
{
type zeroGradient;
}
bottleWall
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
frontAndBack
{
type empty;
}
}


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

flowris August 21, 2013 02:35

In comparison to the original case of Hamida, there are no differences in 0/U.

However, 0/pd and 0/gamma.org are:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.4.1                                |
|  \\  /    A nd          | Web:      http://www.openfoam.org              |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/

// Field Dictionary

FoamFile
{
    version        2.0;
    format          ascii;

    root            "/home/hassan/OpenFOAM/hassan-1.4.1/run/interFoam";
    case            "fillBottle";
    instance        "0";
    local          "";

    class          volScalarField;
    object          pd;
}

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


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

internalField  uniform 0;

boundaryField
{
    inlet         
    {
        type            zeroGradient;
    }

    inletWall     
    {
        type            zeroGradient;
    }

    bottleWall     
    {
        type            zeroGradient;
    }

    atmosphere     
    {
        type            fixedValue;
        value          uniform 0;
    }

    frontAndBack   
    {
        type            empty;
    }
}


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

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.4                                  |
|  \\  /    A nd          | Web:      http://www.openfoam.org              |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version        2.0;
    format          ascii;

    root            "";
    case            "";
    instance        "";
    local          "";

    class          volScalarField;
    object          gamma;
}

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


dimensions      [0 0 0 0 0 0 0];

internalField  uniform 0;

boundaryField
{
    inlet       
    {
        type            zeroGradient;
    }

    inletWall     
    {
        type            zeroGradient;
    }

    bottleWall     
    {
        type            zeroGradient;
    }

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

    defaultFaces   
    {
        type            empty;
    }
}


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

you can still download the files here: http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2007/

vishal_s August 21, 2013 06:19

flowris, thanks for the prompt reply.But why in the initial dynamic pressure field , the boundary condition for the atmosphere field is kept "fixed zero".Don't you think as the as the water
starts entering the atmosphere, the dynamics pressure is going to have some finite value??

flowris August 21, 2013 06:33

That is totally reasonable. If I remember well, the tutorial case ends before the bottle is completely filled. All I did was giving you the BCs of the original tutorial, I am not saying they are the most physically correct ones. Did you try it with these?

vishal_s August 26, 2013 15:07

Flowris,I tried both BCs and it doesn't makes much difference. I would be really grateful, if you may kindly look at the initial boundary conditions for turbulence, I am trying for last few days but unable to get the proper result.May you kindly tell what is the mistake.

File for epsilon :

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

dimensions [0 2 -3 0 0 0 0];

internalField uniform 0.1;

boundaryField
{
inlet
{
type fixedValue;
value uniform 0.1;
}
inletWall
{
type epsilonWallFunction;
value uniform 0.1;
}
bottleWall
{
type epsilonWallFunction;
value uniform 0.1;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0.1;
value uniform 0.1;
}
frontAndBack
{
type empty;
}
}


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

FIle for k :

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

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

internalField uniform 0.1;

boundaryField
{
inlet
{
type fixedValue;
value uniform 0.1;

}
inletWall
{
type kqRWallFunction;
value uniform 0.1;
}
bottleWall
{
type kqRWallFunction;
value uniform 0.1;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0.1;
value uniform 0.1;
}
frontAndBack
{
type empty;
}
}


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

FIle for nut :

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

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

internalField uniform 0.1;

boundaryField
{
inlet
{
type fixedValue;
value uniform 0.1;
}
inletWall
{
type nutkWallFunction;
value uniform 0.1;
}
bottleWall
{
type nutkWallFunction;
value uniform 0.1;
}
atmosphere
{
type calculated;
value uniform 0;
}
defaultFaces
{
type empty;
}
}


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

File for nuTilda:

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

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

internalField uniform 0.1;

boundaryField
{
inlet
{
type fixedValue;
value uniform 0;
}

inletWall
{
type fixedValue;
value uniform 0;
}

bottleWall
{
type fixedValue;
value uniform 0;
}

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

frontAndBack
{
type empty;
}
}

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


All times are GMT -4. The time now is 13:41.