CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   multiphaseInterFoam: timestep error by simulating a co-extrusion nozzle (https://www.cfd-online.com/Forums/openfoam-solving/113942-multiphaseinterfoam-timestep-error-simulating-co-extrusion-nozzle.html)

Quatschinsky March 1, 2013 06:58

multiphaseInterFoam: timestep error by simulating a co-extrusion nozzle
 
1 Attachment(s)
Hey FOAMers,

I am a new OpenFOAM 2.1.1. user and have a problem which I try to solve since 10 days.
Here my case:
I want to simulate a coextrusion nozzle and a Jet-Breakup at the nozzle outlet with the multiphaseInterFoam solver but the timesteps decrease and the Simulation stops after 30 to 80 s (clocktime).
Here a cut of the logfile:
Code:

Courant Number mean: 7.84266e-07 max: 0.107767
Interface Courant Number mean: 0 max: 0
deltaT = 1.11151e-20
Time = 1.3215936608538546e-07

MULES: Solving for alphawater
water volume fraction, min, max = -7.55787e-09 -0.000570536 1
MULES: Solving for alphaoil
oil volume fraction, min, max = -1.4893e-07 -0.0336218 1
MULES: Solving for alphaair
air volume fraction, min, max = 1 0.999999 1
Phase-sum volume fraction, min, max = 1 0.966378 2
MULES: Solving for alphawater
water volume fraction, min, max = -7.55787e-09 -0.000570536 1
MULES: Solving for alphaoil
oil volume fraction, min, max = -1.4893e-07 -0.033558 1
MULES: Solving for alphaair
air volume fraction, min, max = 1 0.999999 1
Phase-sum volume fraction, min, max = 1 0.966442 2
MULES: Solving for alphawater
water volume fraction, min, max = -7.55787e-09 -0.000570536 1
MULES: Solving for alphaoil
oil volume fraction, min, max = -1.4893e-07 -0.0334928 1
MULES: Solving for alphaair
air volume fraction, min, max = 1 0.999999 1
Phase-sum volume fraction, min, max = 1 0.966507 2
MULES: Solving for alphawater
water volume fraction, min, max = -7.55787e-09 -0.000570536 1
MULES: Solving for alphaoil
oil volume fraction, min, max = -1.4893e-07 -0.0334262 1
MULES: Solving for alphaair
air volume fraction, min, max = 1 0.999999 1
Phase-sum volume fraction, min, max = 1 0.966574 2
smoothSolver: Solving for Ux, Initial residual = 0.0105473, Final residual = 0.00090196, No Iterations 6
smoothSolver: Solving for Uy, Initial residual = 0.000925167, Final residual = 6.16274e-05, No Iterations 6
smoothSolver: Solving for Uz, Initial residual = 0.00888806, Final residual = 0.000632785, No Iterations 4
GAMG: Solving for p_rgh, Initial residual = 0.694822, Final residual = 0.0291662, No Iterations 2
time step continuity errors : sum local = 7.81989e-08, global = -1.29592e-12, cumulative = -1.15696e-07
GAMGPCG: Solving for p_rgh, Initial residual = 0.105286, Final residual = 2.9533e-08, No Iterations 11
time step continuity errors : sum local = 1.21996e-13, global = 8.31433e-15, cumulative = -1.15696e-07
ExecutionTime = 32.15 s ClockTime = 32 s

Courant Number mean: 1.38081e-06 max: 0.207025
Interface Courant Number mean: 0 max: 0
deltaT = 5.36895e-21
Time = 1.3215936608539084e-07

#0  Foam::error:[IMG]file:///C:\Users\Leon\AppData\Local\Temp\msohtmlclip1\01\clip_image001.gif[/IMG]rintStack(Foam::Ostream&)  in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/libc.so.6"
#3 at multiphaseMixture.C:0
#4 Foam::multiphaseMixture::solveAlphas(double) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libmultiphaseInterFoam.so"
#5 Foam::multiphaseMixture::solve() in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libmultiphaseInterFoam.so"
#6
in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/multiphaseInterFoam"
#7 __libc_start_main in "/lib/libc.so.6"
#8
in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/multiphaseInterFoam"
Floating point exception

Made the geometrie with blockMesh, in paraFoam it looks ok and according to checkMesh it is. Already varied between fine (~35000 cells) and coarse grid (~15000 cells) with no improvment.

A Image of teh geometry is attached: Inlet1 is Oil and Inlet2 Water, the Internalfield is filled with air.
Tried several kinds of Boundary conditions for U (velocity), p_rgh (totalpressure, fixedValue and zeroGradient for inlets and outlet) and alphas (fixedvalue and zeroGradient for inlets) but none of them worked, the current 0 folder looks as follows:

U:

Code:

dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet1
{
type fixedValue;
value uniform (0 0 -0.1);
}
inlet2
{
type fixedValue;
value uniform (-707 0 -0.707);
}
outlet
{
type zeroGradient;
}
atmos
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
fixedWall
{
type fixedValue;
value uniform (0 0 0);
}
nozzle
{
type fixedValue;
value uniform (0 0 0);
}
front
{
type wedge;
}
back
{
type wedge;
}
}

p_rgh:
Code:

dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet1
{
type zeroGradient;
}
inlet2
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
fixedWall
{
type zeroGradient;
}
atmos
{
type totalPressure;
p0 uniform 0;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
value uniform 0;
}
nozzle
{
type zeroGradient;
}
front
{
type wedge;
}
back
{
type wedge;
}
}

alphair:
Code:

dimensions [0 0 0 0 0 0 0];

internalField uniform 1;

boundaryField
{
inlet1
{
type zeroGradient;
}
inlet2
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
atmos
{
type inletOutlet;
inletValue uniform 1;
value uniform 1;
}
fixedWall
{
type zeroGradient;
}
nozzle
{
type zeroGradient;
}
front
{
type wedge;
}
back
{
type wedge;
}
}



alphawater:

Code:

dimensions [0 0 0 0 0 0 0];

internalField uniform 0;

boundaryField
{
inlet1
{
// type fixedValue;
// value uniform 0;
type zeroGradient;
}
inlet2
{
type fixedValue;
value uniform 1;
}
outlet
{
type zeroGradient;
}
atmos
{
type zeroGradient;
}
fixedWall
{
type zeroGradient;
}
nozzle
{
type zeroGradient;
}
front
{
type wedge;
}
back
{
type wedge;
}
}



alphaoil:

Code:

dimensions [0 0 0 0 0 0 0];

internalField uniform 0;

boundaryField
{
inlet1
{
type fixedValue;
value uniform 1;
}
inlet2
{
// type fixedValue;
// value uniform 0;
type zeroGradient;
}
outlet
{
type zeroGradient;
}
atmos
{
type zeroGradient;
}
fixedWall
{
type zeroGradient;
}
nozzle
{
type zeroGradient;
}
front
{
type wedge;
}
back
{
type wedge;
}
}




How mentioned I use the multiphaseInterFoam solver of the dambreak tutorial, without any changes. In the fvSolution file i played with the cAlpha ( 0 to 2) without any result.

fvSolution:
Code:

solvers
{
pcorr
{
solver PCG;
preconditioner
{
preconditioner GAMG;
tolerance 1e-05;
relTol 0;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration off;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 2;
}
tolerance 1e-05;
relTol 0;
maxIter 100;
}

p_rgh
{
solver GAMG;
tolerance 1e-07;
relTol 0.05;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration on;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}

p_rghFinal
{
solver PCG;
preconditioner
{
preconditioner GAMG;
tolerance 1e-07;
relTol 0;
nVcycles 2;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration on;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
tolerance 1e-07;
relTol 0;
maxIter 20;
}

U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-08;
relTol 0.1;
}

UFinal
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-08;
relTol 0.1;
nSweeps 1;
}
}

PIMPLE
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
nAlphaSubCycles 4;
cAlpha 2;
}

relaxationFactors
{
fields
{
}
equations
{
"U.*" 1;
}
}



fvSchemes:
Code:

FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
default Euler;
}

gradSchemes
{
default Gauss linear;
grad(U) Gauss linear;
grad(gamma) Gauss linear;
}

divSchemes
{
div(rho*phi,U) Gauss upwind;
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss interfaceCompression;
}

laplacianSchemes
{
default Gauss linear corrected;
}

interpolationSchemes
{
default linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
pcorr;
p_rgh;
"alpha.*";
}

In the controlDict i varied the deltaT (1e-5 to 1e-10) and the maxCo and maxAlphaCo (0.8 to 0.1).
Controldict:
Code:

application multiphaseInterFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 2;

deltaT 1e-9;

writeControl runTime;

writeInterval 2e-02;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;

adjustTimeStep yes;

maxCo 0.1;
maxAlphaCo 0.1;

maxDeltaT 1e-01;

I am very clueless what the problem is about, guess it has something to do with my solversettings, but have no idea about that. In the past days I searched a lot in the forum to find likewise problems and tried to transfer the proposals on my case without any result.
Maybe someone can help me to find the problem.
Thank you in advance,
Leon

Quatschinsky March 15, 2013 10:49

problem solved. Need to put a small field of the phases directly at the inlets and everything works fine.

salame March 27, 2013 03:24

hi, did you mean need a setfieldsDict to initialize the internalfield? like:
...
regions
(
boxToCell
{
box ( 0 0 -1 ) ( 0.1461 0.292 1 );
fieldValues
(
volScalarFieldValue alphawater 1
volScalarFieldValue alphaoil 0
...

salame March 28, 2013 01:35

Hi, Quatschinsky:
From tutorial of the solver like dambreak4phase, I found the file "alphaair" write like this:
boundaryField
{
leftWall
{
type alphaContactAngle;
thetaProperties
(
( water air ) 90 0 0 0
( oil air ) 90 0 0 0
( mercury air ) 90 0 0 0
( water oil ) 90 0 0 0
( water mercury ) 90 0 0 0
( oil mercury ) 90 0 0 0
);
value uniform 0;
}
....
but yours did not like this, can u tell me whether there are some default setting in it?

Quatschinsky April 1, 2013 10:07

Hey salame

Yeah, exactly i mean setting Fields with the setFieldsdict.
If you just set the Value of the phase at the Inlet equal 1 in the alpha files it was not working but with running the setFieldsdict it is. Just the first 5 to 10 cells at the inlet need to be field with the phase also.

You just need alphacontactangle if the angle between the wall and the phases is not equal 90°. If it is equal 90° you can also take zeroGradient.

Regards,
Leon

salame April 2, 2013 21:04

Quote:

Originally Posted by Quatschinsky (Post 417592)
Hey salame

Yeah, exactly i mean setting Fields with the setFieldsdict.
If you just set the Value of the phase at the Inlet equal 1 in the alpha files it was not working but with running the setFieldsdict it is. Just the first 5 to 10 cells at the inlet need to be field with the phase also.

You just need alphacontactangle if the angle between the wall and the phases is not equal 90°. If it is equal 90° you can also take zeroGradient.

Regards,
Leon

I see, Thank u! Your reply is very detailed.
by the way, i think a extend question.
If the two fluids are injected one by one, how set the setfieldsDict?
is it ok that i reset the setfieldsDict file after the first fluid finish injection?
then how can i determine the revelant "volScalarFieldValue"?

mebinitap June 26, 2013 05:59

buiding problem
 
Hi all,

I tried to make multiphaseInterFoam solver in my user directory but got the error as follows :

SOURCE=mymultiphaseInterFoam.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I../myinterFoam -ImultiphaseMixture/lnInclude -I/opt/openfoam220/src/transportModels -I/opt/openfoam220/src/transportModels/incompressible/lnInclude -I/opt/openfoam220/src/transportModels/interfaceProperties/lnInclude -I/opt/openfoam220/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam220/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/mymultiphaseInterFoam.o
mymultiphaseInterFoam.C:36:33: fatal error: mymultiphaseMixture.H: No such file or directory
compilation terminated.
make: *** [Make/linuxGccDPOpt/mymultiphaseInterFoam.o] Error 1

wmake libso in the multiphaseMixture inside the directory worked fine. Can anyone please let me know where the error is ?

(Hopefully it kind of belongs to the same thread)

Thanks

becklei March 27, 2014 05:08

Quote:

Originally Posted by Quatschinsky (Post 414244)
problem solved. Need to put a small field of the phases directly at the inlets and everything works fine.

hi, Quatschinsky:
I met the problem quite same with you. I can not understand " put a small field of the phases directly at the inlets". Can you give me a more detailed explanation.
Thank you in advance!:)


All times are GMT -4. The time now is 18:26.