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/)
-   -   stedystate twoPhaseEulerFoam ? (http://www.cfd-online.com/Forums/openfoam-solving/63397-stedystate-twophaseeulerfoam.html)

sersunzo April 7, 2009 09:25

stedystate twoPhaseEulerFoam ?
 
Hi everybody,

I'm new to OpenFoam and I need some information concerning twoPhaseEulerFoam solver.

Can be used for steady state solutions? I'm simulating a electrolytic cell. Basically, it is a channel where hydrogen bubbles are generated at one of the walls. I run the transient simulation without problems, but when I changed in the file fvSchemes:

ddtSchemes
{
default Euler;
}

to

ddtSchemes
{
default steadyState;
}

the code gives the following error

#0 Foam::error::printStack(Foam::Ostream&) in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted: [0xb7f3b400]
#3 Foam::DILUPreconditioner::calcReciprocalD(Foam::Fi eld<double>&, Foam::lduMatrix const&) in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 Foam::DILUPreconditioner::DILUPreconditioner(Foam: :lduMatrix::solver const&, Foam::Istream&) in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 Foam::lduMatrix::preconditioner::addasymMatrixCons tructorToTable<Foam::DILUPreconditioner>::New(Foam ::lduMatrix::solver const&, Foam::Istream&) in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#6 Foam::lduMatrix::preconditioner::New(Foam::lduMatr ix::solver const&, Foam::Istream&) in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#7 Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#8 Foam::fvMatrix<double>::solve(Foam::Istream&) in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#9 Foam::fvMatrix<double>::solve() in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/twoPhaseEulerFoam"
#10 main in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/twoPhaseEulerFoam"
#11 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#12 Foam::regIOobject::readIfModified() in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/twoPhaseEulerFoam"
Floating point exception

I do not understand if it depends on the fact that the solver cannot be used for steady state simulations or if I have to modify something else somewhere (I did not change anything in the controlDict for instance).

Thanks for the help

Alessio

l_r_mcglashan April 8, 2009 05:34

You probably have to relax the equations. Add a subdictionary to fvSolution. As an example:

relaxationFactors
{
p 0.3
...etc
}

Be sure that your solution will reach a steady state though.

sersunzo April 8, 2009 13:42

Dear Laurence,

thanks for your reply. I modified the fvSolution file. Now it looks like this

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

solvers
{
p PCG
{
preconditioner none;
tolerance 1e-05;
relTol 0;
};
Ua PBiCG
{
preconditioner none;
tolerance 1e-05;
relTol 0;
};
Ub PBiCG
{
preconditioner none;
tolerance 1e-05;
relTol 0;
};
alpha PBiCG
{
preconditioner none;
tolerance 1e-10;
relTol 0;
};
beta PBiCG
{
preconditioner none;
tolerance 1e-10;
relTol 0;
};
Theta PBiCG
{
preconditioner none;
tolerance 1e-05;
relTol 0;
};
k PBiCG
{
preconditioner none;
tolerance 1e-05;
relTol 0;
};
epsilon PBiCG
{
preconditioner none;
tolerance 1e-05;
relTol 0;
};
}

SIMPLE
{
nNonOrthogonalCorrectors 0;
}

PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
nAlphaCorr 2;
correctAlpha no;
pRefCell 0;
pRefValue 0;
}

relaxationFactors
{
p 0.3;
Ua 0.3;
Ub 0.3;
alpha 0.3;
}
// ************************************************** *********************** //

Turbulence and granular models are off and so beta, k, epsilon and theta are not important.

I have two questions I hope you can answer.

1) Shouldn't be SIMPLE instead of PISO the algorithm for stady-state? This is what I thought, but if I remove PISO OpenFoam complains that "keyword PISO is undefined in dictionary..."

2) I still missing something because if I run the case with the new fvSolution I got the following error

"previous iteration field
IOobject: volScalarField p "/home/sersunzo/OpenFOAM/sersunzo-1.5/run/MELPRIN/channel_wedin_type/h5/i=200/steady_state/0"

not stored. Use field.storePrevIter() at start of iteration.#0 Foam::error::printStack(Foam::Ostream&) in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/twoPhaseEulerFoam"
#3 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::prevIter() const in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/twoPhaseEulerFoam"
#4 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::relax(double) in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/twoPhaseEulerFoam"
#5 main in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/twoPhaseEulerFoam"
#6 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#7 Foam::regIOobject::readIfModified() in "/home/sersunzo/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/twoPhaseEulerFoam"


From function GeometricField<Type, PatchField, GeoMesh>::prevIter() const
in file /home/dm2/henry/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/GeometricField.C at line 814.

FOAM aborting"

Do you have any idea what is wrong?

Thanks in advance.

Alessio

alberto April 8, 2009 18:09

The two-fluid solver is unsteady, so you should actually run an unsteady simulation, until the steady state, if it exists, is reached.

If you are sure a steady state exists, you can under-relax and use bigger time steps. The simulation won't be time accurate, but the final condition will be OK. If you want time accuracy, you should not under-relax because the code does not perform sub-iterations to ensure the solution is completely evolved during each time step when under-relaxation is applied.

OT question: Alessio, did you do your Ph.D. in Torino? :-)

Best regards,

sersunzo April 8, 2009 20:27

Thanks Alberto,

last question. When I tried to underelax (transient case) I simply added something like this

relaxationFactors
{
p 0.3;
Ua 0.3;
Ub 0.3;
alpha 0.3;
}

to the fvSolutions file.

But I think I am missing something else I got an error of this type.

"IOobject: volScalarField p "/home/sersunzo/OpenFOAM/sersunzo-1.5/run/MELPRIN/channel_wedin_type/h5/i=200/steady_state/0" not stored. Use field.storePrevIter() at start of iteration"

It looks like the code does not save the previous time step for the relaxation... Do you know how this can be fixed?

PS. Si' Alberto sono di Torino, ci conosciamo?

alberto April 8, 2009 20:52

Hi,

remove the pressure under-relaxation coefficient. In twoPhaseEulerFoam you can under-relax the following variables: Ua, Ub, alpha, beta, Theta, k, epsilon.

Ciao, ci conosciamo di nome e di vista. Ero un dottorando del prof. Baldi. Trovi la mia mail nel profilo del forum. :)

Best regards,

smart January 8, 2010 13:01

Steady-State solver
 
Hi all,

I am working on two-phase flow in convergent-divergent nozzle with bubble flow at the entrance. The pressure difference encountered a phase change and heat transfer. To solve this problem, I have to include phase chance and heat transfer in twoPhaseEulerFoam and to add compressibility. In addition, I would like a steady-state solver so I have to modify this aspect too. Is it possible?

Thank you and have a nice day,

Sylvain


All times are GMT -4. The time now is 16:35.