Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - william

Pages: 1 ... 4 5 [6] 7 8 ... 11
76
CFX / Re: Fluid with a non-Newtonian viscosity dependence in CFX.
« on: May 11, 2012, 10:47:51 PM »
There are various non-Newtonian viscosity models available in CFX as beta features.
The available models are the Herschel-Bulkley, Bird-Carreau, Cross, and Power-Law
models. The Bingham Plastic model can be set up as a special case of the Herschel-Bulkley
model.

To enable access to the models, you can modify the RULES file located in the /etc folder
of the CFX installation directory as follows.

1. First copy the existing RULES file to another file (say RULES.OLD) so that the original file is preserved.
2. Edit the RULEs file and find the object:

SINGLETON: DYNAMIC VISCOSITY

Replace the entire SINGLETON: DYNAMIC VISCOSITY object with the corresponding object contained
in the attached file short_rules.

3. Save the modified RULES file and start the CFX launcher. If you edit an existing definition file
using the Solver Manager, you will be able to change the Option for Dynamic Viscosity for a particular material
to one of the non-Newtonian options. You must then add and set the desired parameters for that
particular model.

77
The reason could be the value for the parameter Maximum Particle Integration Time Step.

SOLVER CONTROL:
PARTICLE CONTROL:
PARTICLE INTEGRATION:
Maximum Particle Integration Time Step = x s
END
END
END


The time step is automatically calculated from the ratio of a length scale (element edge length) over the particle velocity. So when the particle velocity is very small, the time step will be very large. By default the maximum limit on this parameter is also very large at 1.e+10s. So there is a chance that the time step can exceed the maximum tracking time hence the diagnostic about exceeding the time limit.

So the solution is to specify a smaller value for the Maximum Particle Integration Time Step. We would recommend basing this on the edge length of an element and the fluid velocity.

78
In this case, particles are not injected at every time step, but are injected at every nth timestep or some other frequency. In order to accomplish this, the particle mass flow rate should be specified as a function of time using an expression ( step function will have to be used ), and then set the number of particles per unit time dependent on the mass flow rate. (That is why this option exists.) Alternatively, you may wish to use a particle injection region with User Fortran.

For example, if we are running a transient case with time step of 0.01 s and we want a particle to be injected at t = 0.1 s and t = 0.2 s the setup would appear as follows:

##------------------------------------------------------------------------------
#
# Creating an expression to turn the particle injection on and off
#
##------------------------------------------------------------------------------

LIBRARY:
CEL:
EXPRESSIONS:
particle mass flow = 0.0037418 [kg/s]* \
(step((t-0.099)/1)*step((0.101-t)/1)\
+step((t-0.199)/1)*step((0.201-t)/1))total time = 0.5
tstep = 0.01
END
END
END

##------------------------------------------------------------------------------
#
# Using the CEL expression for particle mass flow:
# particle mass flow = 0.0037418 [kg/s] @ t = 0.01 , 0.02
# otherwise, particle mass flow = 0 [kg/s]
#
# Note 0.0037418 kg/s is equivalent to 100 copper particles per second.
#
##------------------------------------------------------------------------------


FLOW:
SIMULATION TYPE:
Option = Transient
INITIAL TIME:
Option = Automatic with ValueTime = 0
END
TIME DURATION:
Option = Total Time
Total Time = total time
END
TIME STEPS:
Option = Timesteps
Timesteps = tstep
END
END
DOMAIN: Domain 1
Domain Type = Fluid
Fluids List = Water
Particles List = Copper
BOUNDARY: In1
Boundary Type = INLET
Location = in1
BOUNDARY CONDITIONS:
FLOW REGIME:
Option = Subsonic
END
MASS AND MOMENTUM:
Normal Speed = 1 [m s^-1]
Option = Normal Speed
END
TURBULENCE:
Option = Medium Intensity and Eddy Viscosity Ratio
END
END
FLUID: CopperBOUNDARY CONDITIONS:
MASS AND MOMENTUM:
Option = Zero Slip Velocity
END
PARTICLE MASS FLOW RATE:
Mass Flow Rate = particle mass flow
END
PARTICLE POSITION:
Option = Uniform Injection
##------------------------------------------------------------------------------
#
# One particle will be injected:
# Since there will be 100 injection points per kg:
# - when the flow rate is 0 kg/s, there will be no injection points
# - when the flow rate is 0.0037418 kg/s, at a timestep of 0.01
# 3.7418e-5 kg will be injected. So the number of injection points will be
# 100 points/kg * 3.7148e-5 kg = 0.0037148 injection points. Since the
# number of injection points is rounded up to the nearest integer,
# a value of 1 is assigned to the number of injection point.
#
##------------------------------------------------------------------------------
NUMBER OF POSITIONS:
Number per Unit Time and Mass Flow Rate = 100 [kg^-1]
Option = Proportional to Mass Flow Rate
END

END
END
END
END
BOUNDARY: Outlet
Boundary Type = OUTLET
Location = outBOUNDARY CONDITIONS:
FLOW REGIME:
Option = Subsonic
END
MASS AND MOMENTUM:
Option = Average Static Pressure
Relative Pressure = 0 [Pa]
END
PRESSURE AVERAGING:
Option = Average Over Whole Outlet
END
END
END
FLUID: Copper
FLUID MODELS:
MORPHOLOGY:
Option = Dispersed Particle Transport Fluid
##------------------------------------------------------------------------------
#
# 1 [mm] particle injected
#
##------------------------------------------------------------------------------
PARTICLE DIAMETER DISTRIBUTION:
Diameter = 1 [mm]
Option = Specified Diameter
END
END
END
END
END
END

79
When you run local timestep factor the solver does not assemble a pseudo transient term because it is not needed. Local timestep factor is a different approach (to the default) for controlling how fast we solve the equations in the non-linear loop. This factor is applied to the central coefficient of the linear equation only after the linear equation has been completely assembled, with all it's contributions. eg: advection, diffusion, gradient & body forces in the momentum equation. Each of these individual terms will contribute to the central coefficient and imply a grid/physics based timescale.

The numerical method is not explicit when you run this way. A correct assessment would be to say that usage of the local timestep factor can limit the rate at which you can approach steady state solution to an explicit timescale, for each coefficient loop iteration. We still assemble & solve coupled implicit linear equations; however, once the LTF is applied the problem can only go forward at the rate of the smallest timescale for each iteration. This usually means you are limited by regions where the grid is "fine".

Local timestep factor, like the pseudo timescale approach, is a relaxation in the sense that it controls how fast the solution can change at each coefficient loop. This is the traditional definition of under relaxation. While an equation for LTF may not be written in the form phi = phi_new*urf + (1-urf)*phi_old it could be rewritten that way.

When you run in the default mode, with a pseudo transient, there is a transient term. If you use a small timestep then the central coefficient, Ap, will be large (because the transient coefficient is rho*vol/dt) and the case can only be solved at the rate allowed by that small timestep. There is no implied timescale in this case because you are telling the code what that timescale is.

With localtimestep factor, when you multiply the central coefficient by (1+1/E),we modify the "implied" timescale in the linear equation. This is similar to the pseudo transient except that the unmodified "raw" timescale is implied by the Ap that we came up with by assembling advection, diffusion, gradient, etc... If E is large (>>1) then you basically get the raw "implied" timescale. If E is small, say O(1), then you get a modification to the raw implied timescale.

In an equation form the new Ap is this:

Ap_new = Ap_raw * (1 + 1/E) = Ap_raw + Ap_raw/E (1)

The term "Ap/E" can be interpreted as a transient term because it has the same form as "rho*vol/dt". So, the timescale implied by the local timestep factor is:

rho*vol/dt = Ap_raw/E (2)

or

dt = rho*vol*E/Ap_raw (3)

Several properties can be stated by inspecting equation (3):
- Large E (>>1) implies a larger timestep, maximum is the amount given by Ap_raw though.
- Small E, O(1), implies a smaller timestep
- The timestep will spatially vary throughout the volume
- The timestep will be small where you have small control volumes, larger where the control volumes are larger
- Most practical boundary layer grids don't work well with local timestep factor because the volumes in the boundary layer tend to be so small relative to the volumes in the core flow regions.
- High aspect ratio grids also don't work so well because the raw Ap will be significant in these regions and if you use by an O(1) E you make the modified Ap even larger which slows things down even more.
- Because of the last two points you can generally say that LTF can cause you nowhere because it freezes the solution where the grid volumes are large. It might make things even worse in some cases because you are not actually solving the problem.

A reference for the implementation it the following paper:

J. P. Van Doormaal and G. D. Raithby.
Enhancements of the simple method for predicting incompressible fluid flows.
Numerical Heat Transfer, 7:147-163, 1984

80
CFX / Re: Simulating heat transfer in a closed room
« on: May 11, 2012, 10:36:23 PM »
Closed rooms have no outlets or openings so there is no boundary for the solver to use as a pressure reference region.
In addition, if there is heat transfer into the room it will heat up and the pressure will increase.
The following advice should improve convergence:

(1)
Compute an expression for the average room pressure from P = <rho>*R*<T>/W, where <> implies volumed averaged.
For example:

AverageDensity = volumeAve(density )@Domain 1
AverageTemperature = volumeAve(T)@Domain 1
AveragePressure = AverageDensity*R*AverageTemperature/W

The above expression for the average pressure assumes that W is the molecular weight of the fluid and that an ideal gas is being used.

(2)
Set the reference pressure equal to the average room pressure.

(3)
Run in double precision.

81
The fluid level is not a variable. One needs to use other available variable to detect the position of the free surface.
A good indicator is a gradient of density or volume fraction. This gradient will have its maximum at the surface level.

Therefore, define a line at the location of interest, parallel to the gravity vector (i.e. perpendicular to the fluid surface).

To visualize the location of the surface, create a chart with the ordinate displaying Density. Gradient. Its maximum will be at the free surface.

82
CFX / Re: Newtons method failed to converge in 100 iterations.
« on: May 11, 2012, 10:33:12 PM »
Check the CCL for your combustion calculation. For each domain, the combustion model section might read as follows:

In dom1:

FLUID MODELS:
COMBUSTION MODEL:
Eddy Dissipation Model Coefficient B = 0.5
Extinction Temperature = 5000[K]*(1-fcomb1)+700[K]*fcomb1
Option = Eddy Dissipation
END

In dom2:

FLUID MODELS:
COMBUSTION MODEL:
Eddy Dissipation Model Coefficient B = 0.5
Extinction Temperature = 5000[K]*(1-fcomb2)+700[K]*fcomb2
Option = Eddy Dissipation
END

In dom3:

FLUID MODELS:COMBUSTION MODEL:
Eddy Dissipation Model Coefficient B = 0.5
Extinction Temperature = 5000[K]*(1-fcomb3)+700[K]*fcomb3
Option = Eddy Dissipation
END

Finally, in sparks:

FLUID MODELS:
COMBUSTION MODEL:
Eddy Dissipation Model Coefficient B = 0.5
Extinction Temperature = 5000[K]*(1-fcombs)+700[K]*fcombs
Option = Eddy Dissipation
END

The expression fcombs = fcomb1 + fcomb2 + fcomb3 should be added to the CEL section.

83
To be able to select different wall boundary conditions for different fluids, you need to:
1) set 'Fluid Dependent' option for 'Turbulence' in the Fluid models
2) on the Boundary Condition settings tab, select 'Fluid Dependent' option for 'Wall Influence On Flow'. An extra tab 'Fluid Values' will appear. There you can set up different boundary conditions for different fluids.

84
CFX / Re: Error: Cannot calculate total enthalpy
« on: May 11, 2012, 10:28:18 PM »
CFX-Pre is not using the correct logic to determine whether or not a Total Temperature (Inlet) or Opening Temperature (Opening) should be permitted. The solver does not support Opening boundary conditions with an Opening Temperature set, or Inlet boundary conditions with a Total Temperature set, for multiphase cases with more than one continuous fluid, where the density of the continuous phases is not constant. CFX-Pre allows this setup, however, and the error above is the result.

CFX-Pre also disallows the use of Total (or Opening) Temperature for single-phase cases with thermal energy and a constant density fluid, when the solver does support this condition.

In general, Total (or Opening) Temperature should be permitted in the following situations:
1) the simulation uses the thermal energy or total energy model, and
2) it is single phase OR multiphase with only one continuous phase OR multiphase with constant density fluids.

There are some additional restrictions which apply for real gases.

Use a Static Temperature setting instead of an Opening or Total Temperature.

85
There is no energy equation for the solid phase when porous domain is defined. The only way to simulate the energy transfer between the solid and the fluid phase of the porous media flow is to define an additional variable (AV), which will represent enthalpy or energy of the solid phase. For heat in a solid, one needs to select a 'Diffusion Transport Equation' under 'Fluid Models', and define a Kinematic diffusivity for this diffusion equation.

To calculate effective thermal conductivity, specify the following expression

K_eff=(void fraction)*(a_fluid*rho_fluid*Cp_fluid)+(1-(void fraction))*(a_solid*rho_solid*Cp_solid)

(where 'a' is a kinematic diffusivity). Usually, fluid thermal conductivity is known, therefore

K_eff=(void fraction)*k_fluid+(1-(void fraction))*(a_solid*rho_solid*Cp_solid)

86
 The behavior of the oil particles under various conditions is controlled by many factors including the chosen Drag model, i.e. Ishii-Zuber or some other model that might be applicable. The Ishii-Zuber drag model handles sparse and dense dispersed fluid (i.e. non-solid) particles automatically. Details of the Ishii-Zuber model can be found in the documentation: ANSYS CFX-Solver Theory Guide | Multiphase Flow Theory | Interphase Momentum Transfer Models |

For modeling of a change in flow behavior for dense packing conditions, using a drag model that provides a different calculation of the drag coefficient for different packing is essential.
The packing at the walls can be kept within reasonable limits by setting the maximum packing factor (default =1.0). This should prevent droplets from accumulating past an unrealistic packing value.

Other factors like flow field, surface finish, surface tension, etc. impact the behavior of fluid layers near walls.

87
CFX / Re: How the Herschel-Bulkley model works in CFX?
« on: May 11, 2012, 10:09:36 PM »
The shear rates are clipped using the minimum and maximum shear rate parameters. The solver then calculates a viscosity based on these clipped values. This ensures that the viscosity does not become infinite at zero shear rate - it will just approach the limiting value at the minimum shear rate. The same thing will happen at the high end of the range. In practice, most polymers approach Newtonian behavior at low and high shear rates, which this implementation should model properly.

The yield stress will be used as the equations show. Since the shear rate is clipped to a minimum value, there¿s no testing required to see if the shear stress lies above a certain value for deformation - a minimum shear rate will always be used in the calculation.

88
CFX / Re: Model beam deflection by stresses
« on: May 11, 2012, 10:07:17 PM »
Set up your ANSYS structural analysis as usual. Just remember to put a Fluid-Solid interface on the solid surface that meets the fluid. You can go ahead and run and save your analysis.

In CFX, you can set up a transient simulation with external coupling to ANSYS. You will specify that
CFX will receive Total Mesh Displacement from ANSYS but will pass it back nothing.

You need only run a time step or two.

Under Solver Control, you will specify for ANSYS to solve first.

Once its all set up, run the problem. The deformed mesh will be present in the CFX results file. You can import the mesh from this results file into a new session of CFX-Pre so that the deformed mesh will now be available for a new CFD simulation.

89
In CFX it is possible to set a buoyancy reference density which causes the gravity head associated with this density to be removed from the pressure field. Thus, with a single, incompressible fluid, if you set the buoyancy reference density equal to the fluid density you can set a constant pressure at a vertical pressure boundary. However, when there is more than one fluid, as is the case with free surface flows, it is not possible to completely eliminate the gravity head from the pressure field and so an expression must be used. Firstly, an assumption needs to be made about the height of the free surface at the vertical boundaries.

To see how using a buoyancy reference density affects the expression for the pressure imagine a domain in which z is vertical with z=0 at the bottom, z=h at the height of the water and z=zTop at the top of the domain.
Thus, the volume fraction of air (vfair) and water (vfwater) can be given by:
vfair = step(z-h);
vfwater = 1 -vfair

The absolute pressure (pabs) is then:

pabs = pTop
+ vfair*rhoair*g*(zTop-z)
+ vfwater*rhoair*g*(zTop-h)
+ vfwater*rhowater*g*(h-z)

when using a non zero buoyancy reference density (rhoref)

pabs = p + pref + rhoref*g.(r-rref) [scalar product for vectors g, r, rref]
= p + pref - rhoref*g*(z-zref) [g in -z direction]

=> p = pabs - pref + rhoref*g*(z-zref)
= pabs - pref + vfair*rhoref*g*(z-zTop + zTop-zref)
+ vfwater*rhoref*g*(z-h + h-zTop + zTop-zref)

=> p = pTop - pref + vfair*rhoref*g*(zTop-zref) + vfwater*rhoref*g*(zTop-zref)
+ vfair*(rhoair-rhoref)*g*(zTop-z)
+ vfwater*(rhoair-rhoref)*g*(zTop-h)
+ vfwater*(rhowater-rhoref)*g*(h-z)

By setting appropriate values for zref and rhoref (e.g. zref=zTop, rhoref=rhoair) many of the terms in the above expression will disappear.
However, this expression is easy to get wrong. For example, the expression in tutorial 7 (up to CFX-11.0 at least) is not correct.
Also, given that it is not possible to completely eliminate the gravity head many people prefer to set the buoyancy reference density to zero and use the first expression for the pressure (with p = pabs -pref) which is a lot easier to formulate.

90
Wall roughness is a hidden beta feature for omega_based turbulence. To activate this, a manual CCL edit of the Fluid Models section and each wall boundary is required.

First, activate the CFX 11.0 beta Features under Edit à Options_ CFX-Pre (see attached). Then, set SST up the default way and write out the .def file. Finally, extract the ccl from the .def file using the cfx5cmds executable and modify the ccl as shown below to activate scalable wall functions (if desired) and wall roughness height. (For instructions on the use of cfx5cmds, type "cfx5cmds help" in a CFX Commandline window (in Windows) or at the command prompt (Linux/Unix).)

Below are CCL examples using automatic and scalable wall functions respectively.


Automatic wall treatment
This is the default. In order to specify the automatic near wall treatment explicitly, the Option parameter in `TURBULENT WALL FUNCTIONS (under the FLUID MODELS section see attached) must be set to `Rough Wall Omega Automatic.

In the following, an example is given for a heated wall with automatic wall treatment:

BOUNDARY : Bottom
Boundary Type =WALL
Location = RCT B
BOUNDARY CONDITIONS :
WALL INFLUENCE ON FLOW :
Option = No Slip
TURBULENT WALL FUNCTIONS:
Option = Rough Wall Omega Automatic
END
END
WALL ROUGHNESS:
Option = Rough Wall
Roughness Height = 0.0005 [m]
END # WALL ROUGHNESS
HEAT TRANSFER:
Option = Fixed Temperature
Fixed Temperature = 8.E1 [K]
TURBULENT WALL FUNCTIONS:
Option = Rough Wall Omega Automatic
END
END # HEAT TRANSFER
END


Scalable wall functions
In order to specify the scalable wall functions, the Option parameter in `TURBULENT WALL FUNCTIONS must be set to `Rough Wall Omega Scalable. The example shows the parameters for a heated wall with scalable wall functions. The default value of the lower - limit (Minimum Yplus) is 2.5 and can be changed via the ccl:

BOUNDARY : Bottom
Boundary Type = WALL
Location = RCT B
BOUNDARY CONDITIONS :
WALL INFLUENCE ON FLOW :
Option = No Slip
TURBULENT WALL FUNCTIONS :
Option = Rough Wall Omega Scalable
Rough Wall Minimum Yplus = 2.5
END
END
WALL ROUGHNESS:Option = Rough Wall
Roughness Height = 0.0005 [m]
END # WALL ROUGHNESS
HEAT TRANSFER:
Option = Fixed Temperature
Fixed Temperature = 8.E1 [K]
TURBULENT WALL FUNCTIONS :
Option = Rough Wall Omega Scalable
END
END # HEAT TRANSFER
END

In addition, an expert parameter must be set to use the max-function for the computation of the effective diffusion coefficients.

EXPERT PARAMETERS :
effective viscosity type = 2
END

Pages: 1 ... 4 5 [6] 7 8 ... 11