CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Is good initial guess field is neccessary ? (http://www.cfd-online.com/Forums/openfoam/107968-good-initial-guess-field-neccessary.html)

 mmkr825 October 10, 2012 13:28

Is good initial guess field is neccessary ?

Hi foamers,
i developed my own solver for predicting velocity profile(U) and particle concentration profile(T) for suspension flow (fluid+particles). And in my momentum equation, the viscosity is not constant, it is function of particle volume fraction(T).
And i written the momentum equation as follows:

tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
- fvm::laplacian(nu*pow(1-T/0.68,-1.82), U)
);
UEqn().relax();

sources.constrain(UEqn());

where T is the particle volume fraction (dimensionless scalar field).

For predicting particle volume fraction(T), the governing equation written as:

solve
(
fvm::div(phi, T)
- fvm::laplacian(0.62*1.82*pow(a,2)*g*pow(T,2)*pow(0 .68-T,-1), T)
- fvm::laplacian(0.41*pow(a,2)*g*T, T)
==
fvc::laplacian(0.41*pow(a,2)*T*T, g)
);

Where g = local shear rate
= sqrt(2*E:E)

when i run my case (simple channel flow) by using my solver, initially it is giving the following error.

error message:-

Create time

Create mesh for time = 0

No field sources present

SIMPLE: convergence criteria
field p tolerance 0.01
field U tolerance 0.001
field T tolerance 1e-05

Starting time loop

Time = 1

DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 4.00548e-06, No Iterations 4
DILUPBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
#0 Foam::errorprintStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 FoamDILUPreconditioner::calcReciprocalD(Foam::Fi eld<double>&, Foam::lduMatrix const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#4 FoamDILUPreconditionerDILUPreconditioner(Foam: :lduMatrix::solver const&, Foam::dictionary const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#5 Foam::lduMatrixpreconditioner::addasymMatrixCons tructorToTable<FoamDILUPreconditioner>::New(Foam ::lduMatrix::solver const&, Foam::dictionary const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#6 Foam::lduMatrixpreconditioner::New(Foam::lduMatr ix::solver const&, Foam::dictionary const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#7 FoamPBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#8 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libfiniteVolume.so"
#9 Foam::fvMatrix<double>::solve() in "/home/malli_reddy/OpenFOAM/malli_reddy-2.1.1/platforms/linuxGccDPOpt/bin/myDiffusiveFoam"
#10
in "/home/malli_reddy/OpenFOAM/malli_reddy-2.1.1/platforms/linuxGccDPOpt/bin/myDiffusiveFoam"
#11 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#12
in "/home/malli_reddy/OpenFOAM/malli_reddy-2.1.1/platforms/linuxGccDPOpt/bin/myDiffusiveFoam"
Floating point exception
malli_reddy@ubuntu:~/OpenFOAM/malli_reddy-2.1.1/PROJECT/myDiffusive\$

But when i give good initial guess (by running the same case by using another solver in which coefficients are constants), then the case is running and giving good results. My geometry is 2D channel flow. when i run my case with checkMesh, it given no errors.

And i used SIMPLE scheme for pressure velocity coupling. And for
laplacian() Gauss linear corrected;
div() Gauss linear;

To generalize my solver should i shift to any other schemes?

cheers
Mallikarjuna

 Bernhard October 11, 2012 01:44

My guess would be, that the first time you solve the equation for T, g=0, which is causing problems in the matrix equation you are constructing. When you have a non-constant initial velocity, g evaluates to non-zero value. Maybe you can calculate g at the end of a time-step and initialize it with a non-zero value?

 mmkr825 October 11, 2012 02:08

Hi Bernhard,
For g i given the following boundary conditions:-

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

internalField uniform 10;

boundaryField
{
leftWall
{
type calculated;
}

fixedWalls
{
type calculated;
}

rightWall
{
type calculated;
}

frontAndBack
{
type empty;
}
}

Initially i given uniform 0 for internal fields. According to your suggestion i changed it to 10. But the result is same (giving error). I given non zero for internal fields only. Could you please tell me how to give non zero for boundary patches also.

Thanks
Regards
Mallikarjuna

 Bernhard October 11, 2012 02:13

I am not sure how you defined g in the solver, but do you really need an 0/g file? Cannot you define this field just in the solver? Also does it not conflict with gravity? How do you initialize T?

 mmkr825 October 11, 2012 02:28

Hi bernhard,
I can define g in the solver. But i am using groovyBC for T. In that i need g. For that i defined g as volScalarField. I don't know actually, whether it conflict with gravity or not.

I initialized T as:

dimensions [0 0 0 0 0 0 0];

internalField uniform 0.02;

boundaryField
{
leftWall
{
type fixedValue;
value uniform 0.4;
}
fixedWalls
{
type groovyBC;
g g;
fractionExpression "0";
evaluateDuringConstruction 0;
variables "";
timelines (
);
lookuptables (
);
}
rightWall
{
}
frontAndBack
{
type empty;
}
}

Thanks
Regards
Mallikarjuna

 mmkr825 October 17, 2012 12:58

Hi Bernhard,
I don't know whether i should dig here or not. I am thinking this thread is still alive. I have not solved my problem. Is there any suggestions about it?

Thanks
Regards
Mallikarjuna

 All times are GMT -4. The time now is 22:24.