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

groovyBC results in negative alpha

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 11, 2011, 10:30
Default groovyBC results in negative alpha
  #1
aot
New Member
 
Andreas Otto
Join Date: Sep 2009
Posts: 11
Rep Power: 9
aot is on a distinguished road
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?
aot is offline   Reply With Quote

Old   October 12, 2011, 03:59
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   October 12, 2011, 04:37
Default
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,972
Rep Power: 41
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by aot View Post
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
gschaider is offline   Reply With Quote

Old   October 13, 2011, 08:58
Smile problem solved
  #4
aot
New Member
 
Andreas Otto
Join Date: Sep 2009
Posts: 11
Rep Power: 9
aot is on a distinguished road
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
Attached Images
File Type: jpg circulatingSplash.jpg (33.7 KB, 81 views)
aot is offline   Reply With Quote

Old   October 13, 2011, 15:12
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,972
Rep Power: 41
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Andreas!

Quote:
Originally Posted by aot View Post
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 View Post
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
gschaider is offline   Reply With Quote

Old   December 12, 2013, 04:42
Default
  #6
New Member
 
Faraj
Join Date: Feb 2010
Posts: 22
Rep Power: 8
Filankes is on a distinguished road
set alpha = 0.5 to all field
Filankes is offline   Reply With Quote

Old   December 12, 2013, 05:29
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,972
Rep Power: 41
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Filankes View Post
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"?
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
BlockMesh FOAM warning gaottino OpenFOAM Native Meshers: blockMesh 7 July 19, 2010 14:11
[ICEM] Hex refinement negative quality afterwards Anorky ANSYS Meshing & Geometry 8 March 22, 2010 04:25
Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00
Problems with repeating results Lee CD-adapco 4 May 26, 2006 03:39
Determining alpha and beta for porous baffle Liaqat Khan CD-adapco 1 October 27, 2000 04:44


All times are GMT -4. The time now is 20:48.