ANSYS-CFX Time Dependent Boundary Conditions
http://www.edr.no/index.php/blogg/ansys_bloggen/ansys_turtorial_cfx_transient_profile
http://www.padtinc.com/blog/the-focus/cfx-expressions-part-4
http://www.edr.no/blogg/ansys_bloggen/ansys_tutorial_time_operations_in_cfx
http://www.padtinc.com/blog/the-focus/cfx-expressions-part-4
http://www.edr.no/blogg/ansys_bloggen/ansys_tutorial_time_operations_in_cfx
Example
It is useful sometimes to save the CEL code on a text file and then copy the functions when ever you setup a simulation. Remmber to right click on the expressions and then select command editor.
LIBRARY:
CEL:
&replace EXPRESSIONS:
ChamberRatio = area()@REGION:inin22
D = 3.8e-6 [m^2 sec^-1]
InnerSoilArea = 0.200936 [m^2]
MWCO2 = 44 [kg/kmole]
Slop1 = 100 []
Slop2 = 90 []
SoilDepth = 0.615[m]
TimeRatio = t/TotalTime
TotalTime = 260 [sec]
Ufan = (Umean *Slop1 *TimeRatio)/(1+Slop1 *TimeRatio )
Umean = 1.7[m/sec]
VCO2 = ef /(1.98[kg m^-3] )
YAIR = 1-YCO2
YCO2 = fromPPM *(YCO2Mean *Slop2 *TimeRatio)/(1+Slop2 *TimeRatio )
YCO2Mean = 900
correection = 0.09 [m^-3 kmole ]
ef = -correection *D*MWCO2 *(YCO2 )/SoilDepth+1e-6 [kg m^-2 sec^-1]
fromPPM = 1e-6 [ ]
END
END
CEL:
&replace EXPRESSIONS:
ChamberRatio = area()@REGION:inin22
D = 3.8e-6 [m^2 sec^-1]
InnerSoilArea = 0.200936 [m^2]
MWCO2 = 44 [kg/kmole]
Slop1 = 100 []
Slop2 = 90 []
SoilDepth = 0.615[m]
TimeRatio = t/TotalTime
TotalTime = 260 [sec]
Ufan = (Umean *Slop1 *TimeRatio)/(1+Slop1 *TimeRatio )
Umean = 1.7[m/sec]
VCO2 = ef /(1.98[kg m^-3] )
YAIR = 1-YCO2
YCO2 = fromPPM *(YCO2Mean *Slop2 *TimeRatio)/(1+Slop2 *TimeRatio )
YCO2Mean = 900
correection = 0.09 [m^-3 kmole ]
ef = -correection *D*MWCO2 *(YCO2 )/SoilDepth+1e-6 [kg m^-2 sec^-1]
fromPPM = 1e-6 [ ]
END
END
Example 2
LIBRARY:
CEL:
&replace EXPRESSIONS:
(10[kg m^-1 sec^-2]*aitern/0.1)*step(0.1-aitern)+(10[kg m^-1 sec^-2 ]*aitern/0.5)*step(0.5-aitern)+(14[ kg m^-1 sec^-2]*aitern/0.6)*step(0.6-aitern)+(20[kg m^-1 sec^-2 ]*aitern/0.8)*step(0.8-aitern)+(20[kg m^-1 sec^-2 ]*aitern/1.8)*step(1.8-aitern)+(20[kg m^-1 sec^-2 ]*aitern/2.8)*step(2.8-aitern)+(20[kg m^-1 sec^-2 ]*aitern/4.8)*step(4.8-aitern)
END
END
CEL:
&replace EXPRESSIONS:
(10[kg m^-1 sec^-2]*aitern/0.1)*step(0.1-aitern)+(10[kg m^-1 sec^-2 ]*aitern/0.5)*step(0.5-aitern)+(14[ kg m^-1 sec^-2]*aitern/0.6)*step(0.6-aitern)+(20[kg m^-1 sec^-2 ]*aitern/0.8)*step(0.8-aitern)+(20[kg m^-1 sec^-2 ]*aitern/1.8)*step(1.8-aitern)+(20[kg m^-1 sec^-2 ]*aitern/2.8)*step(2.8-aitern)+(20[kg m^-1 sec^-2 ]*aitern/4.8)*step(4.8-aitern)
END
END
Example 3
LIBRARY:
CEL:
&replace EXPRESSIONS:
AIRC = (1-sin(Omegaa*t))
Omegaa = 2*pi*f
ParticalDistribution = meandiameter *(1-sin(Omegaa*t))
Spray = Umax *sin(Omegaa*t)
Uav = 0.5 [m/s]
Umax = 40[m/s]
WATERC = sin(Omegaa*t)
f = n [hertz]
meandiameter = 1e-6 [m]
n = 0.05
END
END
END
CEL:
&replace EXPRESSIONS:
AIRC = (1-sin(Omegaa*t))
Omegaa = 2*pi*f
ParticalDistribution = meandiameter *(1-sin(Omegaa*t))
Spray = Umax *sin(Omegaa*t)
Uav = 0.5 [m/s]
Umax = 40[m/s]
WATERC = sin(Omegaa*t)
f = n [hertz]
meandiameter = 1e-6 [m]
n = 0.05
END
END
END
Example 4
LIBRARY:
CEL:
&replace EXPRESSIONS:
AIRCON = (1-0.00277777777777777777777777777778[s^-1]*(t ))
CO2CON = 0.00277777777777777777777777777778[s^-1]*(t )
Copy of AIRCON = 0.69*exp(-0.03[s^-1]*(t ))+0.31
Copy of CO2CON = 1-Copy of AIRCON
FluxCO2 = Micromoles *(Ratio2 *(probe(CO2.Density)@Point 1)*( probe(CO2.Volume Fraction)@Point 1))
L = 0.25[m]
MWCO2 = 44 [kg/kmole]
Micromoles = 1000000 [ ]
Permibilityf = 0.01[m^2]*(y/L)+1.2e-12[m^2]
Porosityf = 0.01*(y/L)+0.45
Ratio = (volume()@REGION:Chamber)/area()@Domain Interface 2 Side 1
Ratio2 = Ratio/MWCO2
TT = 360[s]
a = 0.5 [kg m^-2 s^-1]
b = 12 [m]
concentration = numberofmoles/volume()@Volume 1
cv = 1
function = a*(y/L)+5e-5 [kg m^-2 s^-1]
numberofmoles = mass(CO2)@Volume 1/MWCO2
END
END
END
CEL:
&replace EXPRESSIONS:
AIRCON = (1-0.00277777777777777777777777777778[s^-1]*(t ))
CO2CON = 0.00277777777777777777777777777778[s^-1]*(t )
Copy of AIRCON = 0.69*exp(-0.03[s^-1]*(t ))+0.31
Copy of CO2CON = 1-Copy of AIRCON
FluxCO2 = Micromoles *(Ratio2 *(probe(CO2.Density)@Point 1)*( probe(CO2.Volume Fraction)@Point 1))
L = 0.25[m]
MWCO2 = 44 [kg/kmole]
Micromoles = 1000000 [ ]
Permibilityf = 0.01[m^2]*(y/L)+1.2e-12[m^2]
Porosityf = 0.01*(y/L)+0.45
Ratio = (volume()@REGION:Chamber)/area()@Domain Interface 2 Side 1
Ratio2 = Ratio/MWCO2
TT = 360[s]
a = 0.5 [kg m^-2 s^-1]
b = 12 [m]
concentration = numberofmoles/volume()@Volume 1
cv = 1
function = a*(y/L)+5e-5 [kg m^-2 s^-1]
numberofmoles = mass(CO2)@Volume 1/MWCO2
END
END
END
Example 5
LIBRARY:
CEL:
&replace EXPRESSIONS:
L = 0.25[m]
Porosityf = 0.001*(y/L)+0.45
a = 0.5 [kg m^-2 s^-1]
b = 12 [m]
function = a*(y/L)+1.2e-12 [kg m^-2 s^-1]
END
END
END
CEL:
&replace EXPRESSIONS:
L = 0.25[m]
Porosityf = 0.001*(y/L)+0.45
a = 0.5 [kg m^-2 s^-1]
b = 12 [m]
function = a*(y/L)+1.2e-12 [kg m^-2 s^-1]
END
END
END
Example 6
LIBRARY:
CEL:
&replace EXPRESSIONS:
FluxCO2 = (Ratio2 *(probe(CO2.Density)@Point 1)*( probe(CO2.Volume Fraction.Difference)@Point 1))
L = 0.25[m]
MWCO2 = 44 [kg/kmole]
Porosityf = 0.001*(y/L)+0.45
Ratio = (volume()@REGION:Chamber)/area()@Domain Interface 2 Side 1
Ratio2 = Ratio/MWCO2
a = 0.5 [kg m^-2 s^-1]
b = 12 [m]
concentration = numberofmoles/volume()@Volume 1
function = a*(y/L)+1.2e-12 [kg m^-2 s^-1]
numberofmoles = mass(CO2)@Volume 1/MWCO2
trial = t.Difference
END
END
END
CEL:
&replace EXPRESSIONS:
FluxCO2 = (Ratio2 *(probe(CO2.Density)@Point 1)*( probe(CO2.Volume Fraction.Difference)@Point 1))
L = 0.25[m]
MWCO2 = 44 [kg/kmole]
Porosityf = 0.001*(y/L)+0.45
Ratio = (volume()@REGION:Chamber)/area()@Domain Interface 2 Side 1
Ratio2 = Ratio/MWCO2
a = 0.5 [kg m^-2 s^-1]
b = 12 [m]
concentration = numberofmoles/volume()@Volume 1
function = a*(y/L)+1.2e-12 [kg m^-2 s^-1]
numberofmoles = mass(CO2)@Volume 1/MWCO2
trial = t.Difference
END
END
END
Example 7
LIBRARY:
CEL:
&replace EXPRESSIONS:
AIRCON = 1-CO2CON
C = (probe(CO2.Volume Fraction )@point2*1.98[kg m^-3])/44[kg/kmole]
C0 = (probe(CO2.Volume Fraction )@point1*1.98[kg m^-3])/44[kg/kmole]
Const = volume()@Chamber/area()@ChamberSoil Side 1
Flux = Const*(C-C0)/360[s]
Temp = 280[K]+30[K]*(t/360[s])*exp(-t/360[s])
END
END
END
CEL:
&replace EXPRESSIONS:
AIRCON = 1-CO2CON
C = (probe(CO2.Volume Fraction )@point2*1.98[kg m^-3])/44[kg/kmole]
C0 = (probe(CO2.Volume Fraction )@point1*1.98[kg m^-3])/44[kg/kmole]
Const = volume()@Chamber/area()@ChamberSoil Side 1
Flux = Const*(C-C0)/360[s]
Temp = 280[K]+30[K]*(t/360[s])*exp(-t/360[s])
END
END
END
Example 8
Expression Value =
force_x_Coord 1()@airfoil * 2 / (massFlowAve(Density)@inlet *
(massFlowAve(Velocity)@inlet)^2*0.6 [m]* 1[m])
Monitor Points and Expressions Add New Item Name = Drag Coef OK
Option = Expressions Expression Value =
force_z_Coord 1()@airfoil * 2 / (massFlowAve(Density)@inlet *
(massFlowAve(Velocity)@inlet)^2*0.6 [m]* 1[m])
force_x_Coord 1()@airfoil * 2 / (massFlowAve(Density)@inlet *
(massFlowAve(Velocity)@inlet)^2*0.6 [m]* 1[m])
Monitor Points and Expressions Add New Item Name = Drag Coef OK
Option = Expressions Expression Value =
force_z_Coord 1()@airfoil * 2 / (massFlowAve(Density)@inlet *
(massFlowAve(Velocity)@inlet)^2*0.6 [m]* 1[m])
Pressure Coefficient (Cp)
Expression = p/(0.5*massFlowAve(Density)@inlet*(massFlowAve(Velocity)@inlet)^2)
Using Conditional Statments
waterHt = 6 [cm]
• waterVF = if(y<waterHt,1,0)*if(y>-0.01 [m],1,0)* if(x>-0.028 [m],1,0)
• waterDen = 998 [kg m^-3]
• HydroP = waterDen * g * (waterHt - y) * waterVF
• waterVF = if(y<waterHt,1,0)*if(y>-0.01 [m],1,0)* if(x>-0.028 [m],1,0)
• waterDen = 998 [kg m^-3]
• HydroP = waterDen * g * (waterHt - y) * waterVF
Unless otherwise noted, all content on this site is @Copyright by Ahmed Al Makky 2012-2015 - http://cfd2012.com