### Recent Posts

Pages: 1 2 3 [4] 5 6 ... 10
31
##### CFX / Choosing a suitable physical timescale in CFX calculation
« Last post by admin on November 13, 2016, 02:27:21 PM »
For a single phase turbulent flow with or without heat transfer, the 'Auto Timescale' should be used. If you have more complicated physics, such as multiphase flow, flow resistance, or flow with reactions, then you should choose a physical timescale that is appropriate for your physics.

Most physical models require additional source terms and the timescale can often be estimated from them. For example, if we consider a quadratic flow resistance on a filter of length scale, d, then the momentum equation would be:

density*dv/dt = ... + 0.5*Cd*density*(v^2)/d

The timescale, dt, implied by this model is estimated from

v/dt = 0.5*Cd*(v^2)/d or dt = 2*d/(Cd*v)

So if d = 1 mm, Cd = 0.6 and v = about 10 m/s, dt = 3 x 10^-4 s.

The form of the source term can be obtained from the ANSYS CFX theory manual.

Once you have run a first case then look at the last number on the right in the residual table for each iteration in the out file. For example:

----------------------------------------------------------------------
| Equation | Rate | RMS Res | Max Res | Linear Solution |
+----------------------+------+---------+---------+------------------+
| U-Mom-Bulk | 0.84 | 6.3E-05 | 3.4E-03 | 1.6E-03 OK|
| V-Mom-Bulk | 0.87 | 1.4E-04 | 6.5E-03 | 4.4E-03 OK|
| W-Mom-Bulk | 0.84 | 6.3E-05 | 3.8E-03 | 1.5E-03 OK|
| P-Vol | 0.77 | 2.4E-06 | 1.0E-04 | 9.0 2.9E-03 OK|
+----------------------+------+---------+---------+------------------+
| Mass-Fluid1 | 0.91 | 2.3E-05 | 1.2E-03 | 10.7 3.3E-08 OK|

The numbers in the 'Linear Solution' column (1.6E-3, 4.4E-3, etc) tell you the residual from the linear solver but they can also be considered to be the fraction of non-linearity in the equation. Ideally, you want to choose the timescale so that the non-linearity is about 1 or 2% (i.e. 1e-2). If you increase the timescale, the amount of non-linearity also increases in proportion. In the above example, the timescale for u, v, w and p could be increased by a factor of 3 to get faster convergence. However, the mass fraction called 'Mass-Fluid1' has a non-linearity of only 3.3e-8, which is very small. The timescale for this equation (in CFX Pre Solver Control > Equation Class Settings) could be increased by almost 1,000 times, and the calculation would still be stable.
32
##### CFX / Re: Combustor efficiency
« Last post by william on November 12, 2016, 06:20:29 PM »
The ccl below uses the CEL expression CombEff to adjust the heating values:

LIBRARY:
MATERIAL: Methane Air WD1
Option = Variable Composition Mixture
Reactions List = Methane Air WD1
END # MATERIAL Methane Air WD1
MATERIAL : CH4 # Methane
Option = Pure Substance
PROPERTIES :
Option = Ideal Gas
Molar Mass = 16.04 [kg kmol^-1]
Dynamic Viscosity = 11.1E-06 [kg m^-1 s^-1]
Thermal Conductivity = 343E-04 [W m^-1 K^-1]
Thermal Expansivity = 3.35E-03 [K^-1]
Refractive Index = 1.
Reference Pressure = 1. [atm]
Reference Temperature = 25 [C]
Reference Specific Enthalpy = -74.87310 [kJ mol^-1] / 16.04 [kg kmol^-1]
Reference Specific Entropy = 186.2 [J mol^-1 K^-1] / 16.04 [kg kmol^-1]
SPECIFIC HEAT CAPACITY:
Option = NASA Format
Temperature Limit List = 300 [K], 5000 [K], 1000 [K]
NASA Coefficient List =
NASACoeff21, NASACoeff22, NASACoeff23,
NASACoeff24, NASACoeff25, NASACoeff26,
NASACoeff27,
NASACoeff11, NASACoeff12, NASACoeff13,
NASACoeff14, NASACoeff15, NASACoeff16,
NASACoeff17
END #SPECIFIC HEAT CAPACITY
#
# Boiling point (1 atm) = 111.66 [K]
# Critical Temperature = 190.58 [K]
# Critical Pressure = 4.604E+06 [Pa]
#
END #PROPERTIES
END #MATERIAL

CEL:
EXPRESSIONS:
#
# Combustion of methane: CH4 + 2O2 -> CO2 + 2H2O
#
Rgas = 8314.41 [J kmol^-1]
CombEff = 0.95
HoFCO2 = -393.5224 [kJ mol^-1]
HoFH2O = -241.8264 [kJ mol^-1]
HoFCH4 = -74.8731 [kJ mol^-1]
HeatofProducts = HoFCO2+2*HoFH2O
HeatofReaction = HeatofProducts-HoFCH4
#
# Modify heat of formation ofmethane to account for a
# combustion efficiency of less than 100% using Gordon
# & McBride (NASA) format for enthalpy polynomial
#
HoFCH4Mod = HeatofProducts-CombEff*HeatofReaction
#
NASACoeff11 = 0.07787415E+01
NASACoeff12 = 0.01747668E+00
NASACoeff13 = -0.02783409E-03
NASACoeff14 = 0.03049708E-06
NASACoeff15 = -0.01223931E-09
NASACoeff17 = 0.01372219E+03
Tref1 = 298.15
DHTref11 = NASACoeff11*Tref1 + NASACoeff12*Tref1^2/2 +
NASACoeff13*Tref1^3/3 + NASACoeff14*Tref1^4/4 + NASACoeff15*Tref1^5/5
Tref2 = 1000.0
DHTref12 = NASACoeff11*Tref2 + NASACoeff12*Tref2^2/2 +
NASACoeff13*Tref2^3/3 + NASACoeff14*Tref2^4/4 +
NASACoeff15*Tref2^5/5
NASACoeff16 = HoFCH4Mod/Rgas-DHTref11
# NASACoeff16 = -0.09825229E+05
#
# High temperature polynomial
#
NASACoeff21 = 0.01683479E+02
NASACoeff22 = 0.01023724E+00
NASACoeff23 = -0.03875129E-04
NASACoeff24 = 0.06785585E-08
NASACoeff25 = -0.04503423E-12
NASACoeff27 = 0.09623395E+02
DHTref22 = NASACoeff21*Tref2 + NASACoeff22*Tref2^2/2 +
NASACoeff23*Tref2^3/3 + NASACoeff24*Tref2^4/4 +
NASACoeff25*Tref2^5/5
# Ensure high T and low T polynomials match at Tref2
NASACoeff26 = DHTref12 + NASACoeff16 - DHTref22
# NASACoeff26 = -0.01008079E+06
#
END # EXPRESSIONS
END # CEL
END # LIBRARY

FLOW:

DOMAIN: Combustor
Location = Combustor
Coord Frame = Coord 0
Fluids List = Methane Air WD1
DOMAIN MODELS:
DOMAIN MOTION:
Option = Stationary
END # DOMAIN MOTION
BUOYANCY MODEL:
Option = Non Buoyant
END # BUOYANCY MODEL
REFERENCE PRESSURE:
Reference Pressure = 1.0133E5 [Pa]
END # REFERENCE PRESSURE
END # DOMAIN MODELS

FLUID MODELS:
TURBULENCE MODEL:
Option = k epsilon
END # TURBULENCE MODEL
TURBULENT WALL FUNCTIONS:
Option = Scalable
END # TURBULENT WALL FUNCTIONS
HEAT TRANSFER MODEL:
Option = Thermal Energy
END # HEAT TRANSFER MODEL
COMBUSTION MODEL:
Option = Eddy Dissipation
END # COMBUSTION MODEL
COMPONENT: CH4
Option = Transport Equation
END # COMPONENT CH4
COMPONENT: O2
Option = Transport EquationEND # COMPONENT O2
COMPONENT: CO2
Option = Transport Equation
END # COMPONENT CO2
COMPONENT: H2O
Option = Transport Equation
END # COMPONENT H2O
COMPONENT: N2
Option = Constraint
END # COMPONENT N2
Option = None
END # FLUID MODELS

END # DOMAIN Combustor
END #FLOW
33
##### Fluent / Solution on computing the gradient of the volume fraction for multiphase VOF
« Last post by william on November 12, 2016, 06:17:35 PM »
Suppose you have a multiphase VOF problem in ANSYS Fluent and you wish to calculate the gradient of the volume of fluid variable (VOF). One application would be to determine the local interfacial area of a cell, which is given by the product of the magnitude of the cell VOF gradient and the cell volume.

A User-Defined Function (UDF) can be written (see below) to calculate gradient of a flow variable using User Defined Scalars (UDS) and User Defined Memory locations (UDM). For any UDS, ANSYS Fluent can calculate the gradient using an available macro. Hence, passing the variable to a UDS permits the cell-centered gradient of any flow variable to be calculated. This vector result can then be stored in UDM arrays. The steps for doing this are as follows:
1. Read in the converged case and data
2. Compile the UDF listed below in the Interpreted mode (Define->User Defined->Functions->Intepreted). You may also Compile the UDF for your platform if desired (Define->User Defined->Functions->Compiled).
4. Define UDM (Define->User Defined->Memory 1)
5. Define UDS (Define->User Defined->Scalars 1)
6. Turn off all equations (Solve->Controls->Solution)
7. Do one solver iteration
8. Execute the UDF store_gradient (Define->User Defined->Execute On Demand)

# include ʺudf.hʺ
# define domain_ID 2
{
cell_t c;
face_t f;
domain = Get_Domain(domain_ID);
/* Fill UDS with the variable. */
{ begin_c_loop (c,t)
{ C_UDSI(c,t,0) = C_VOF(c,t); }
end_c_loop (c,t) }
begin_f_loop (f,t)
{F_UDSI(f,t,0) = F_VOF(f,t); }
end_f_loop (f,t) }
}
{
Domain *domain;
cell_t c;
domain=Get_Domain(1); /* Fill the UDM with magnitude of gradient. */
{
begin_c_loop (c,t)
{C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0)); }
end_c_loop (c,t)
}
}
34
##### Fluent / Re: How can I calculate time-average velocity in transient simulation?
« Last post by admin on November 25, 2012, 01:11:34 PM »
Does it work?
CAN anyone help me?

You can follow the instructions given. If you have any issues then you can post it here.
35
##### Fluent / Re: How can I calculate time-average velocity in transient simulation?
« Last post by oliverk on November 24, 2012, 04:41:55 PM »
Does it work?
CAN anyone help me?
36
##### Fluent / Re: How can I calculate time-average velocity in transient simulation?
« Last post by william on November 21, 2012, 10:05:10 AM »
The UDF needs to be compiled. You can not interpret it.
37
##### Fluent / Re: How can I calculate time-average velocity in transient simulation?
« Last post by wissou22 on November 21, 2012, 09:28:20 AM »
dear all
can i just interpret the udf for the calculating of time- average velocity or it must be compiled.
thank you
38
##### Fluent / Re: How can I calculate time-average velocity in transient simulation?
« Last post by oliverk on November 13, 2012, 09:48:16 AM »
Hello

I want to use scheme and utility to get average of velocity in each time step.but I have a problem that the value of all of uds is 0.
can you help me?

meanwhile I use another udf for my case to hook use dynamic mesh..
39
##### Fluent / Re: How can I get new particles after a particle impacting a solid wall?
« Last post by admin on November 09, 2012, 03:00:47 PM »
This feature is available built-in in Fluent. Use the splash option in wall boundary condition for DPM.
Pages: 1 2 3 [4] 5 6 ... 10