Go into the ExtrudateExample/0/
directory. Open the file for p.
In p, the file will read (in part):
boundaryField
{
inlet
{
type
zeroGradient;
}
outlet
{
type
fixedValue;
value
uniform 0;
}
upperWall
{
type
zeroGradient;
}
lowerWall
{
type
zeroGradient;
}
frontAndBack
{
type
empty;
}
}
It will need to be changed to read:
boundaryField
{
F1
{
type
zeroGradient;
}
F2
{
type
fixedValue;
value
uniform 0;
}
Walls
{
type
zeroGradient;
}
}
This is assuming your faces are
F1 for the inlet, F2 for the outlet,
and Walls for the walls. This file defines the outlet pressure to
be 0 Pa. If you are a purist and want absolute pressure instead
of relative pressure, the value can be changed to 101325 (atmospheric
pressure). The simpleFoam example had more faces
defined.
Step 7: Change the velocity file.
Go into the ExtrudateExample/0/
directory. Open the file for U.
In U, the file will read (in part):
boundaryField
{
inlet
{
type
fixedValue;
value
uniform (10 0 0);
}
outlet
{
type
zeroGradient;
}
upperWall
{
type
fixedValue;
value
uniform (0 0 0);
}
lowerWall
{
type
fixedValue;
value
uniform (0 0 0);
}
frontAndBack
{
type
empty;
}
}
It will need to be changed to read:
boundaryField
{
F1
{
type
fixedValue;
value
uniform (.016 0 0);
}
F2
{
type
zeroGradient;
}
Walls
{
type
fixedValue;
value
uniform (0 0 0);
}
}
This is assuming your faces are
F1 for the inlet, F2 for the outlet, and Walls for the walls. The
simpleFoam example had more faces defined. In the F1 value, 0.016
is
the velocity velocity in m/sec in the x direction, the y and z values
are 0 m/sec. 0.016 was chosen as a not atypical value for a small
extruder (50 mm twin screw, for example) feeding 2 die buttons with an
inlet diameter of 1 1/4" (31 mm or so) at a total feed rate of 100
kg/hr. You can calculate your values as suitable.
Step 8: Change the fvSchemes file.
Go into the ExtrudateExample/system/
directory. Open the file for fvSchemes.
In fvSchemes, the file will read (in part):
ddtSchemes
{
default steadyState;
}
Change it to read:
ddtSchemes
{
default Euler;
}
This is a solver that seems to
work better for extrudate problems. The change may not be
necessary.
Step 9: Change the fvSchemes file.
Go into the ExtrudateExample/system/
directory. Open the file for controlDict.
This file, as written, is suitable for relatively simple
problems. The file as it exists, will write output (the line
reading "writeInterval 50;") from simpleFOAM every 50 time
steps. That is 20 directories with all output parameters.
For large meshes, this can add up to a lot hard drive space. For
a steadystate solution, the final result is the only one likely to be
of interest, so 50 could be changed to 1000 (the final time step)
without any loss of your results.
Step 10: Run simpleFoam and see
if it converges.
Run simpleFoam and see if the solution
will converge.
Open a terminal in your ExtrudateExample directory.
Type in "simpleFoam" (without the quotation marks).
Wait. Perhaps for a very long time.
Possible outputs include
- "timestep continuity error". This means the problem will
very much not converge as it is set up.
- Failure to converge. The final error estimates for Ux, Uy,
Uz, or pressure is greater than 10^-5 units. Basically, this
indicates the the problem is not able to solve the problem very
well. Much of the solution may be correct, but there may be some
areas with poor calculations. Treat these solutions with
suspicion. See Step 11 to see how to get a solution for this type
of problem.
- Success. The final error estimates for Ux, Uy, Uz, and
pressure are less than 10^-5 units.
If you get convergence, type "paraFoam" to start ParaView. See
ParaView for pointers on how to display the results.
Step 11: Solutions for shear
thinning problems.
If you have a problem using a shear
thinning fluid (n<1) that fails to converge, one approach is to
solve the simulation for a newtonian fluid, then feed the results for
that problem into the shear thinning simulation. A simplified
version of what you need to do:
- Change the value of n to 1. See Step 5 above for how to do
this.
- Run the simulation. See Step 10 above for how to do this.
- If the solution converges, copy the p and U files from your final
time to the 0 directory. You will replace the U and p files
described in Steps 6 and 7. The files from your final time will
have values for all points in your mesh.
- Change the value of n to your value (0.4 for corn extrudate, as
an example)
- Run the simulation. See Step 10 above for how to do this.
- Hopefully your problem converges and you can view the results
with paraFoam/ParaView.
- It may be necessary to run the solution in an iterative manner,
perhaps running Newtonian first (n=1), then incremental steps until you
reach your value for n. For example you may need to feed the
Newtonian output to a problem with n=0.8, take that output and feed it
into a simulation with n=0.6, and finally feed that output into a
simulation with n=0.4, which will finally give you a solution.
Even smaller steps for n may be needed.
As this approach is "cookbook", it is well suited to being automated
with shell scripts. Look here in the future for a shell script
for the iterative problem with n changing in steps.
Good luck with any simulations you choose to run.