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/)
-   -   Error turbFoam (http://www.cfd-online.com/Forums/openfoam-solving/59612-error-turbfoam.html)

jackdaniels83 June 21, 2007 06:22

Hi, i have modified the turbf
 
Hi,
i have modified the turbfoam solver in a way that i can calculate forces in selected patches.
the problem is that the solver aborts and gives the following message:

Create time

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model kEpsilon
Reading the patch force dictionary
Reading force solver data

Starting time loop

Time = 0.01

Courant Number mean: 0 max: 0
DILUPBiCG: Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 2.34397e-13, No Iterations 1
AMG: Solving for p, Initial residual = 1, Final residual = 0.0483882, No Iterations 1
time step continuity errors : sum local = 0.000553499, global = -8.75052e-07, cumulative = -8.75052e-07
AMG: Solving for p, Initial residual = 0.314146, Final residual = 0.0218164, No Iterations 1
time step continuity errors : sum local = 0.000303637, global = 4.96421e-05, cumulative = 4.8767e-05

Calculating Pressure Forces....
Area of patch cock = 820.124
Pressure force on patch cock = -1.02047e+08 N
Total Pressure Force in cock moving direction = -1.02047e+08 N

Calculating Wall Shear Forces....
Shear Force on patch cock = 0 N
Total Shear Force in cock moving direction = 0N
Total Force in cock moving direction = -1.02047e+08N
#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)
#1 Foam::sigFpe::sigFpeHandler(int)
#2 Uninterpreted: [0xffffe420]
#3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&)
#4 void Foam::divide<foam::fvpatchfield,>(Foam::GeometricF ield<double,>&, Foam::GeometricField<double,> const&, Foam::GeometricField<double,> const&)
#5 Foam::tmp<foam::geometricfield<double,> > Foam::operator/<foam::fvpatchfield,>(Foam::tmp<foam::geometricfie ld<double,> > const&, Foam::GeometricField<double,> const&)
#6 Foam::turbulenceModels::kEpsilon::correct()
#7 main
#8 __libc_start_main
#9 Foam::regIOobject::readIfModified()

Can someone tell me what i have done wrong, because the problem is the same when i use the normal tubfoam solver, too.

Daniel

jackdaniels83 June 21, 2007 07:24

When i turn off turbulence or
 
When i turn off turbulence or choose the laminar turbulence model the problem is gone. What do i have to do, to get the turbulence run?

Daniel

alberto June 21, 2007 07:35

Check you initial and boundary
 
Check you initial and boundary conditions for k and epsilon.

Regards,
Alberto

jackdaniels83 June 21, 2007 07:42

Thanks for you answer! He
 
Thanks for you answer!


Here are my conditions:

object k;
}

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

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

internalField uniform 0;

boundaryField
{
dummyPatch3
{
type zeroGradient;
}
dummyPatch4
{
type zeroGradient;
}
dummyPatch5
{
type zeroGradient;
}
in
{
type fixedValue;
value uniform 0.00375;
}
out
{
type zeroGradient;
}
cock
{
type zeroGradient;



object epsilon;
}

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

dimensions [0 2 -3 0 0 0 0];

internalField uniform 0;

boundaryField
{
dummyPatch3
{
type zeroGradient;
}
dummyPatch4
{
type zeroGradient;
}
dummyPatch5
{
type zeroGradient;
}
in
{
type fixedValue;
value uniform 0.00377;
}
out
{
type zeroGradient;
}
cock
{
type zeroGradient;


object boundary;
}

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


(
dummyPatch3
{
type wall;
physicalType wallFunctions;
startFace 445651;
nFaces 3898;
}

dummyPatch4
{
type wall;
physicalType wallFunctions;
startFace 449549;
nFaces 768;
}

dummyPatch5
{
type wall;
physicalType wallFunctions;
startFace 450317;
nFaces 9312;
}

in
{
type patch;
physicalType pressureInlet;
startFace 459629;
nFaces 1154;
}

out
{
type patch;
physicalType pressureOutlet;
startFace 460783;
nFaces 414;
}

cock
{
type wall;
physicalType wallFunctions;
startFace 461197;
nFaces 508;


I can't see anything wrong with them...

Daniel

alberto June 21, 2007 07:59

The initialization of the inte
 
The initialization of the internal fields is wrong.

With

internalField uniform 0;

you're setting the initial values of k and eps to zero in you whole domain.

Regards,
Alberto

jackdaniels83 June 21, 2007 08:05

Thanks a lot Alberto, I've
 
Thanks a lot Alberto,

I've choosen the same values like for the inlet now and it works, how can i calculate that values for the internal field for different complex parts?

Daniel

alberto June 21, 2007 08:21

If you haven't detailed inform
 
If you haven't detailed information, just use an average value of what you expect k and epsilon to be or the inlet value, as you're doing.

Assuming you simulate for a time long enough, the final result is not influenced by the choice of your initial condition.

With kind regards,
A.

jackdaniels83 June 21, 2007 08:25

Thanks for your fast reply. No
 
Thanks for your fast reply. Now it is working and i can go on with my tests,

Regards,
Daniel

philippose June 25, 2007 16:57

Hello Daniel, A Good day to
 
Hello Daniel,

A Good day to you!

I just happened to be looking through these messages, when I realised that you seem to be using a version of the solver "turbForceFoam", which incorporates rigid body motion (as of now in 1-D).

It would be great if you could give me feedback regarding this modified solver.... have you made any interesting additions to the solver?

Since I am currently making changes to it, it would be nice if you could let me know if there are any specific problems, or improvements which you have come up with while using it.

Awaiting a reply!

Enjoy!

Philippose

jackdaniels83 June 26, 2007 05:11

Hi Philippose, yes i am using
 
Hi Philippose,
yes i am using the turbforcefoam solver. I have modified it because i don't need the body motion. I am only interested in the forces calculated by the solver.
I am simulating hydraulic manifold valves for a automatic gear box and want to have the forces in the direction of the cock motion.

Now a little question: How long has the case to be run to get god values for k and epsilon? I am trying with 100 steps from time 0 to 1e-5 with deltaT = 1e.7.

Regards,

Daniel

jackdaniels83 June 27, 2007 05:35

Another question: the force
 
Another question:

the forces are only written as single values in a file, how can i write them as a field like p or u, so that i can view them in paraView?

Daniel

philippose June 27, 2007 14:22

Hello Daniel, A Good day to
 
Hello Daniel,

A Good day to you!

Its interesting that you are from Baden Wuerttemberg :-)! I guess your town cant be too far from where I am :-)!

Anyway.... as for your questions:

a. Regarding convergence of k and epsilon.... this is dependent on many factors.... for example.... how accurate a solution are you expecting.... how complex the geometry is.... what kind of meshes you are using.... the boundary conditions, etc...etc.... :-)!
I run cases between around 300,000 to around 1.5 Million pure tetrahedral cells, and I have found that "k" is the slowest of all the variables to converge. Epsilon and the velocity variables are more or less the same, and pressure converges the fastest.
My simulations are normally run till an initial residual of around 1e-06, and this normally takes upto around 0.001 seconds, with a variable deltaT which hovers around 4e-07.

b. Since turbForceFoam was written to incorporate the capability of rigid body motion into the fluid solver, I do not calculate the force as a field. Rather, I take a sum of the pressure at each boundary cell, multiplied by the area of the face of that cell which is on the boundary. This results in a single vector, which is the total force on a given patch.
In order to save the force as a field, you will have to create a vector field similar to the velocity ("U") field, and instead of calculating the sum, you need to calculate the force on each patch cell face.
I have not tried this yet, so I cannot give you the exact code to write... but I dont foresee it as being too difficult.

Have a nice day!

Philippose


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