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

Incompressible_simpleFoam_BC

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 20, 2014, 09:43
Default Incompressible_simpleFoam_BC
  #1
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 218
Rep Power: 13
Jiricbeng is on a distinguished road
Hi there,

please help me with the following:
I wish to calculate 3D geometry as an incompressible k-epsilon model with boundary conditions - velocity inlet and pressure outlet (which is likely the most humble task).
Below you can see the individual files. I would be very grateful for any help. I think the problem is especially in settings of k and epsilon..
Thank you very much


wall-4 is inlet
wall-5 is outlet.


The folder 0/p:


internalField uniform 0;
boundaryField
{
//- Set patchGroups for constraint patches
#include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes"
wall-4
{
type zeroGradient;
}
wall-5
{
type fixedValue;
value uniform 0;
}
wall-3
{
type zeroGradient;
}
wall-6
{
type zeroGradient;
}
wall-7
{
type zeroGradient;
}
}
***************



The folder 0/U:

internalField uniform (0 0 0);
boundaryField
{
//- Set patchGroups for constraint patches
#include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes"
wall-4
{
type fixedValue;
value uniform (0 0 1);
}
wall-5
{
type zeroGradient;
}
wall-3
{
type zeroGradient;
}
wall-6
{
type zeroGradient;
}
wall-7
{
type zeroGradient;
}
}
**********************




The folder 0/epsilon:


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

internalField uniform 8.87;
boundaryField
{
wall-3
{
type zeroGradient;
value uniform 8.87;
}
wall-4
{
type freestream;
freestreamValue uniform 8.87;
}
wall-5
{
type zeroGradient;
}
wall-6
{
type zeroGradient;
value uniform 8.87;
}
wall-7
{
type zeroGradient;
value uniform 8.87;
}
}
*******************



The folder 0/k:


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

internalField uniform 0.0158;
boundaryField
{
wall-3
{
type zeroGradient;
value uniform 0.0158;
}
wall-4
{
type freestream;
freestreamValue uniform 0.0158;
}
wall-5
{
type zeroGradient;
}
wall-6
{
type zeroGradient;
value uniform 0.0158;
}
wall-7
{
type zeroGradient;
value uniform 0.0158;
}
}



The folder 0/nut:

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

internalField uniform 0.14;
boundaryField
{
wall-4
{
type calculated;
value $internalField;
}
wall-5
{
type calculated;
value $internalField;
}
wall-3
{
type nutkWallFunction;
value $internalField;
}
wall-6
{
type nutkWallFunction;
value $internalField;
}
wall-7
{
type nutkWallFunction;
value $internalField;
}
}
****************




The folder system/controlDict:

libs
(
"libOpenFOAM.so"
"libincompressibleTurbulenceModel.so"
"libincompressibleRASModels.so"
);
application simpleFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 150;

deltaT 1;

writeControl timeStep;

writeInterval 10;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

runTimeModifiable true;
**************************




The folder system/fvSchemes:

ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss limitedLinearV 1;
div(phi,k) bounded Gauss limitedLinear 1;
div(phi,epsilon) bounded Gauss limitedLinear 1;
div(phi,R) bounded Gauss limitedLinear 1;
div(R) Gauss linear;
div(phi,nuTilda) bounded Gauss limitedLinear 1;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p ;
}
*********************





The folder system/fvSolution:

solvers
{
p
{
solver GAMG;
smoother GaussSeidel;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
tolerance 1e-06;
relTol 0.05;
}
pFinal
{
$p;
tolerance 1e-06;
relTol 0;
}

"(U|k|epsilon)"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-05;
relTol 0.1;
}

"(U|k|epsilon)Final"
{
$U;
tolerance 1e-05;
relTol 0;
}
nuTilda
{
solver smoothSolver;
smoother GaussSeidel;
nSweeps 2;
tolerance 1e-08;
relTol 0.1;
}
}
PIMPLE
{
nOuterCorrectors 4;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
SIMPLE
{
nNonOrthogonalCorrectors 0;
residualControl
{
p 1e-2;
U 1e-3;
"(k|epsilon)" 1e-3;
}
}
relaxationFactors
{
fields
{
p 0.3;
}
equations
{
U 0.7;
k 0.7;
"epsilon.*" 0.7;
}
}
cache
{
grad(U);
}
Jiricbeng is offline   Reply With Quote

Old   March 21, 2014, 12:46
Default
  #2
Member
 
Goncalo Pedro
Join Date: Nov 2009
Location: Victoria, British Columbia
Posts: 30
Rep Power: 16
gonpe is on a distinguished road
Check your syntax for the inlet k and epsilon. You can just use the fixedValue type as you did in the velocity specification.

Check out the pitzDaily tutorial under the /tutorials/incompressible/simpleFoam directory.
gonpe is offline   Reply With Quote

Old   March 24, 2014, 04:53
Default
  #3
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 218
Rep Power: 13
Jiricbeng is on a distinguished road
Thank you for reply. Although I amended the setting according to the Pitzdaily case, solution still fails and vectors in the domain are of zero size.
Have you another idea?
Jiricbeng is offline   Reply With Quote

Old   March 24, 2014, 12:27
Default
  #4
Member
 
Goncalo Pedro
Join Date: Nov 2009
Location: Victoria, British Columbia
Posts: 30
Rep Power: 16
gonpe is on a distinguished road
What do you mean by fails?

What does your output look like?
gonpe is offline   Reply With Quote

Old   March 25, 2014, 02:18
Default
  #5
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 218
Rep Power: 13
Jiricbeng is on a distinguished road
I mean it goes down in 32nd iteration, writing "floating point exception, core dumped". I know the trouble is there is division by zero somewhere, but I do not know where. And if I look at the results from 20th iteration, the velocity vectors in the domain are zero sized. Therefore I assume a boundary condition must be wrong, but I cannot find out where as I created the text files in accordance with pitzDaily case.. I appreciate any help.
Jiricbeng is offline   Reply With Quote

Old   March 25, 2014, 04:03
Default
  #6
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 218
Rep Power: 13
Jiricbeng is on a distinguished road
Obviously the trouble I am coming across:

time step continuity errors : sum local = 2.61612e+11, global = 3.17086e+09, cumulative = 3.17084e+09

and

bounding epsilon, min: -3.46871e-10 max: 1.19867e+08 average: 964.697

In the first 10 iterations velocity in the domain is non-zero but after 20 iterations velocities in the domain (as well as on the boundaries) are entirely of zero size, there is just no flux.
Jiricbeng is offline   Reply With Quote

Old   March 31, 2014, 12:41
Default
  #7
Member
 
Goncalo Pedro
Join Date: Nov 2009
Location: Victoria, British Columbia
Posts: 30
Rep Power: 16
gonpe is on a distinguished road
Is this a simple channel? If so, what does the grid look like? Did you generate it with blockMesh?

Are you able to run a potentialFoam to set up the initial solution? See the potentialFoam tutorial directory.
gonpe is offline   Reply With Quote

Old   April 1, 2014, 02:24
Default
  #8
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 218
Rep Power: 13
Jiricbeng is on a distinguished road
This is a draft tube. Mesh is created in gridpro and is fully hexagonal. It was generated by using "fluentMeshToFoam Mymesh.msh". I am going to try out potentialFoam.
Jiricbeng is offline   Reply With Quote

Old   April 4, 2014, 07:14
Default
  #9
Member
 
Join Date: Jul 2013
Posts: 62
Rep Power: 12
CFDnewbie147 is on a distinguished road
Hello,

did you check the mesh with "checkMesh"? Are there any failures?

Another question: Is it right that you've the only velocity component in the z direction? Does this fit to your tube geometry? 1 m/s?

Did you try it without a turbulence model (laminar)? If it works laminar, you've to look for the failure while using a turbulence model.

Best regards
CFDNewbie147
CFDnewbie147 is offline   Reply With Quote

Old   April 4, 2014, 08:01
Default
  #10
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 218
Rep Power: 13
Jiricbeng is on a distinguished road
I ve already solved out the problem, it was likely caused by a very high value of epsilon, beside that I deleted CrossPowerLawCoeffs from transportProperties and changed divSchemes in fvSchemes from bounded Gauss upwind to Gauss upwind. CheckMesh worked before the changes.
However, comparing results of the draft tube computed in OF and Fluent, although the setting is the same (k-epsilon etc), the results are different. Total pressure decrease in OF is 352Pa and in Fluent it is 297Pa.
Jiricbeng is offline   Reply With Quote

Old   April 10, 2014, 10:06
Default
  #11
Member
 
Join Date: Jul 2013
Posts: 62
Rep Power: 12
CFDnewbie147 is on a distinguished road
Do you use the same mesh or did you make one in OF with snappyHexMesh?

If it's not the same mesh you've used, the mesh could cause the difference. Did you make a mesh-refinement study?
CFDnewbie147 is offline   Reply With Quote

Old   April 11, 2014, 02:12
Default
  #12
Senior Member
 
Jiri
Join Date: Mar 2014
Posts: 218
Rep Power: 13
Jiricbeng is on a distinguished road
It was the same mesh. I do not use snappyHexMesh, I create meshes in ansys. The problem was obviously caused by the boundary k epsilon values. I recommend using this calculation
http://www.cfd-online.com/Tools/turbulence.php
Jiricbeng is offline   Reply With Quote

Reply


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



All times are GMT -4. The time now is 17:08.