CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   groovyBC results in negative alpha (http://www.cfd-online.com/Forums/openfoam-solving/93308-groovybc-results-negative-alpha.html)

aot October 11, 2011 10:30

groovyBC results in negative alpha
 
Hello everyone,
I'm trying to implement groovyBc's in my calculations. I'm using OpenFOAM 2.0.x and started with the circulatingSplash-tutorial from within the latest swak4FOAM-version withot changing anything. Unfortunately the solution run after blockMesh and interDyMFOAM led to strongly negative values for alpha1 and consequently broke very soon after only 4 time steps:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.x |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.0.x-d31ba4c8844f
Exec : interDyMFoam
Date : Oct 11 2011
Time : 16:17:23
Host : donaldduck
PID : 11393
Case : /home/.../OpenFOAM/OpenFOAM-2.0.x/applications/utilities/swak4Foam/Examples/groovyBC/circulatingSplash
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

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

Create mesh for time = 0

Selecting dynamicFvMesh dynamicRefineFvMesh
Reading field p_rgh

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 laminar

Reading g
Calculating field g.h


PIMPLE: Operating solver in PISO mode

time step continuity errors : sum local = 0, global = 0, cumulative = 0
GAMGPCG: Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0, global = 0, cumulative = 0
Courant Number mean: 0 max: 0

Starting time loop

Interface Courant Number mean: 0 max: 0
Courant Number mean: 0 max: 0
deltaT = 0.00025
Time = 0.00025

Selected 0 cells for refinement out of 32768.
Selected 0 split points out of a possible 0.
MULES: Solving for alpha1
Liquid phase volume fraction = 0 Min(alpha1) = 0 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0 Min(alpha1) = 0 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0 Min(alpha1) = 0 Max(alpha1) = 1
swak4Foam: Allocating new repository for sampledGlobalVariables
GAMG: Solving for p_rgh, Initial residual = 1, Final residual = 0.001340854, No Iterations 1
time step continuity errors : sum local = 1.306237e-07, global = -3.144612e-08, cumulative = -3.144612e-08
GAMG: Solving for p_rgh, Initial residual = 0.9365981, Final residual = 0.01857663, No Iterations 3
time step continuity errors : sum local = 8.123623e-07, global = -8.57249e-08, cumulative = -1.17171e-07
GAMGPCG: Solving for p_rgh, Initial residual = 0.004712629, Final residual = 1.693463e-09, No Iterations 6
time step continuity errors : sum local = 2.931039e-13, global = -4.719646e-15, cumulative = -1.17171e-07
ExecutionTime = 1.06 s ClockTime = 1 s

Interface Courant Number mean: 0 max: 0
Courant Number mean: 0.0001562778 max: 0.1799902
deltaT = 0.0001346154
Time = 0.000384615

Selected 0 cells for refinement out of 32768.
Selected 0 split points out of a possible 0.
MULES: Solving for alpha1
Liquid phase volume fraction = -3.943487e-06 Min(alpha1) = -0.03230549 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = -7.886973e-06 Min(alpha1) = -0.06461096 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = -1.183046e-05 Min(alpha1) = -0.09691642 Max(alpha1) = 1
GAMG: Solving for p_rgh, Initial residual = 0.527714, Final residual = 0.01038129, No Iterations 3
time step continuity errors : sum local = 5.175253e-07, global = -2.021781e-07, cumulative = -3.193491e-07
GAMG: Solving for p_rgh, Initial residual = 0.009505424, Final residual = 0.0004487535, No Iterations 3
time step continuity errors : sum local = 3.3844e-08, global = -8.449231e-09, cumulative = -3.277983e-07
GAMGPCG: Solving for p_rgh, Initial residual = 0.0004157884, Final residual = 4.699711e-09, No Iterations 4
time step continuity errors : sum local = 3.91228e-13, global = -3.629063e-14, cumulative = -3.277984e-07
ExecutionTime = 1.42 s ClockTime = 1 s



Does anybody know the reason for this behaviour?

ngj October 12, 2011 03:59

Hi Andreas

Two comments on this:

1. You are beginning with an empty domain and take alpha out of it. Is that what you want?

2. Try to add the momentum predictor in fvSolution and run the simulation again.

My experience with the inter***Foam type solvers is that "2" is required, but in your case it is most probably caused by beginning with an empty domain.

Kind regards,

Niels

gschaider October 12, 2011 04:37

Quote:

Originally Posted by aot (Post 327480)
Hello everyone,
I'm trying to implement groovyBc's in my calculations. I'm using OpenFOAM 2.0.x and started with the circulatingSplash-tutorial from within the latest swak4FOAM-version withot changing anything. Unfortunately the solution run after blockMesh and interDyMFOAM led to strongly negative values for alpha1 and consequently broke very soon after only 4 time steps:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.x |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.0.x-d31ba4c8844f
Exec : interDyMFoam
Date : Oct 11 2011
Time : 16:17:23
Host : donaldduck
PID : 11393
Case : /home/.../OpenFOAM/OpenFOAM-2.0.x/applications/utilities/swak4Foam/Examples/groovyBC/circulatingSplash
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

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

Create mesh for time = 0

Selecting dynamicFvMesh dynamicRefineFvMesh
Reading field p_rgh

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 laminar

Reading g
Calculating field g.h


PIMPLE: Operating solver in PISO mode

time step continuity errors : sum local = 0, global = 0, cumulative = 0
GAMGPCG: Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0, global = 0, cumulative = 0
Courant Number mean: 0 max: 0

Starting time loop

Interface Courant Number mean: 0 max: 0
Courant Number mean: 0 max: 0
deltaT = 0.00025
Time = 0.00025

Selected 0 cells for refinement out of 32768.
Selected 0 split points out of a possible 0.
MULES: Solving for alpha1
Liquid phase volume fraction = 0 Min(alpha1) = 0 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0 Min(alpha1) = 0 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = 0 Min(alpha1) = 0 Max(alpha1) = 1
swak4Foam: Allocating new repository for sampledGlobalVariables
GAMG: Solving for p_rgh, Initial residual = 1, Final residual = 0.001340854, No Iterations 1
time step continuity errors : sum local = 1.306237e-07, global = -3.144612e-08, cumulative = -3.144612e-08
GAMG: Solving for p_rgh, Initial residual = 0.9365981, Final residual = 0.01857663, No Iterations 3
time step continuity errors : sum local = 8.123623e-07, global = -8.57249e-08, cumulative = -1.17171e-07
GAMGPCG: Solving for p_rgh, Initial residual = 0.004712629, Final residual = 1.693463e-09, No Iterations 6
time step continuity errors : sum local = 2.931039e-13, global = -4.719646e-15, cumulative = -1.17171e-07
ExecutionTime = 1.06 s ClockTime = 1 s

Interface Courant Number mean: 0 max: 0
Courant Number mean: 0.0001562778 max: 0.1799902
deltaT = 0.0001346154
Time = 0.000384615

Selected 0 cells for refinement out of 32768.
Selected 0 split points out of a possible 0.
MULES: Solving for alpha1
Liquid phase volume fraction = -3.943487e-06 Min(alpha1) = -0.03230549 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = -7.886973e-06 Min(alpha1) = -0.06461096 Max(alpha1) = 1
MULES: Solving for alpha1
Liquid phase volume fraction = -1.183046e-05 Min(alpha1) = -0.09691642 Max(alpha1) = 1
GAMG: Solving for p_rgh, Initial residual = 0.527714, Final residual = 0.01038129, No Iterations 3
time step continuity errors : sum local = 5.175253e-07, global = -2.021781e-07, cumulative = -3.193491e-07
GAMG: Solving for p_rgh, Initial residual = 0.009505424, Final residual = 0.0004487535, No Iterations 3
time step continuity errors : sum local = 3.3844e-08, global = -8.449231e-09, cumulative = -3.277983e-07
GAMGPCG: Solving for p_rgh, Initial residual = 0.0004157884, Final residual = 4.699711e-09, No Iterations 4
time step continuity errors : sum local = 3.91228e-13, global = -3.629063e-14, cumulative = -3.277984e-07
ExecutionTime = 1.42 s ClockTime = 1 s



Does anybody know the reason for this behaviour?

I know that this case currently doesn't work (it did once and I don't know what changed since). As far as I remember the problem is with the "inlet"-condition. interFoam doesn't like inhomogenous inlets too much anyway and with this one the additional problem is that it is refined and consequently interpolated.

If you get it too run I'd very much apprechiate it if you contribute the relevant changes (I'm sorry, but I currently don't have the time for this)

Just some hints that might be helpful:
- write out every timestep for a failing run and see where the trouble (negative alpha) starts
- try to isolate the problem (although I'm afraid the problem is a mixture of the two):
- make the inlet "stationary" by multiplying all instances of time() with 0
- try to run the transient inlet without mesh refinement

Bernhard

aot October 13, 2011 08:58

problem solved
 
1 Attachment(s)
Dear Bernhard,
you were right, it was a problem with the boundary conditions.
I left alpha1-BCs as given in the example and changed U-BCs to

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

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

internalField uniform (0 0 0);

boundaryField
{
floor
{
type fixedValue;
value uniform (0 0 0);
}
atmosphere
{
type groovyBC;
value uniform (0 0 0);
variables "r1=0.25*(max(pts().x)-min(pts().x));r2=r1*0.2*(1-0.5*cos(54*time()));";
valueExpression "(sqrt(pow(pos().x-r1*sin(10*time()),2)+pow(pos().z-r1*cos(15*time()),2))<r2) ? vector(0,-1,0) : vector(0,0,0)";
}
spill
{
type pressureInletOutletVelocity;
phi phi;
value uniform (0 0 0);
}
sides
{
type pressureInletOutletVelocity;
phi phi;
value uniform (0 0 0);
}
}



and p_rgh-Bcs to

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

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

internalField uniform 0;

boundaryField
{
floor
{
type buoyantPressure;
value uniform 0;
}

sides
{
type totalPressure;
value uniform 0;
p0 uniform 0;
U U;
phi phi;
gamma 1;
value uniform 0;
}

spill
{
type buoyantPressure;
value uniform 0;
p0 uniform 0;
U U;
phi phi;
gamma 1;
value uniform 0;
}

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

}

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



Now the case runs fine at least until the time 0.35s where I stopped the calculation after 16 hours runtime.

By the way: very nice example. Perhaps you can include it in your next version of swak4FOAM.

Andreas

gschaider October 13, 2011 15:12

Hi Andreas!

Quote:

Originally Posted by aot (Post 327812)
Dear Bernhard,
you were right, it was a problem with the boundary conditions.
I left alpha1-BCs as given in the example and changed U-BCs to

Great. I'll try it tomorrow.

Quote:

Originally Posted by aot (Post 327812)
Now the case runs fine at least until the time 0.35s where I stopped the calculation after 16 hours runtime.

By the way: very nice example. Perhaps you can include it in your next version of swak4FOAM.

I'll definitely include it. If you're one of the few who uses the "Development"-version via mercurial then you could do the following

hg commit
hg bundle splashFixBundle

and send me the splashFixBundle-file. That way I can inject it into the repository, the changes will be attributed to you and I can't take credit for fixes I was too lazy to do myself

Bernhard

Filankes December 12, 2013 04:42

set alpha = 0.5 to all field

gschaider December 12, 2013 05:29

Quote:

Originally Posted by Filankes (Post 466060)
set alpha = 0.5 to all field

I've been meditating on this sentence all morning. Is this the interFoam-equivalent to "Kill'em all"?


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