CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

CFX expression error

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 13, 2010, 11:06
Default CFX expression error
  #1
vin
New Member
 
vin
Join Date: May 2010
Posts: 1
Rep Power: 0
vin is on a distinguished road
Hello, everyone

I am newly learner of CFX, recently i study the CFX tutorial example "cavitation-ini" and follow the instruction, then there's appearing error when i define an expression "Ptin=massFlowAve(Total Pressure in Stn Frame)@Inlet".
The error as below:
"ERROR
Attempt to evaluate the CEL callback function 'massFlowAve'.
Although it is valid to create an expression that uses such a function, the preprocessor does not support its evaluation."

Can someone help?
Thank you in advance!
vin is offline   Reply With Quote

Old   January 23, 2011, 07:50
Default
  #2
New Member
 
artemis
Join Date: May 2010
Posts: 8
Rep Power: 16
artemis64s is on a distinguished road
Hi vin
I also have the same problem,
''ERROR Attempt to evaluate the CEL callback function 'maxVal'.
Although it is valid to create an expression that
uses such a function, the preprocessor does not support
its evaluation.''

If you know how to solve this problem, please share it with me.
Thanks
artemis64s is offline   Reply With Quote

Old   January 23, 2011, 20:27
Default
  #3
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,862
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
The simulations should run fine. It is just the pre-processor saying it cannot evaluate the CEL, but the solver should be OK.
ghorrocks is offline   Reply With Quote

Old   November 13, 2014, 09:48
Default similar issues but with material property change..
  #4
Senior Member
 
Join Date: Aug 2014
Location: UK
Posts: 213
Rep Power: 13
fresty is on a distinguished road
Hi Glenn,

I am facing similar issues while trying to simulate water hammer effects in a pipe (with constant angular velocity rotor component in the flow stream path). to be able to observe/ record the wave, I am trying to define the density of water using an expression (function of pressure) as read in one of your previous posts. However, after creating a user material with the expression based density, i am not being able to select that new "user" material due to this error. Could you please help with this, i believe i cant ingore the error like guys above because the material does not change if i just choose to close/ ignore the error box. I am sure i am doing something wrong here.
fresty is offline   Reply With Quote

Old   November 13, 2014, 18:29
Default
  #5
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,862
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Please post your CCL.
ghorrocks is offline   Reply With Quote

Old   November 22, 2014, 07:52
Default
  #6
Senior Member
 
Join Date: Aug 2014
Location: UK
Posts: 213
Rep Power: 13
fresty is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
Please post your CCL.
Sorry for the delay Glenn.

Please, see the CCL of the material, I tried making copy of water and just editing the density by "rho1" the expression that relates pressure difference with Density.
But as mentioned earlier, could not apply this modified material in the Fluid Domain due to error mentioned in previous posts. Similarly, if i apply modified water and then try changing the density to an expression, i encounter similar error.

To mention further, I am trying my luck with "immersed solid" as a valve to break the flow and create the pressure wave.

Hope I can get some help on this.
Cheers.


LIBRARY:
&replace MATERIAL: Copy of Water
Material Description = Water (liquid)
Material Group = Water Data,Constant Property Liquids
Object Origin = User
Option = Pure Substance
Thermodynamic State = Liquid
PROPERTIES:
Option = General Material
ABSORPTION COEFFICIENT:
Absorption Coefficient = 1.0 [m^-1]
Option = Value
END
DYNAMIC VISCOSITY:
Dynamic Viscosity = 8.899E-4 [kg m^-1 s^-1]
Option = Value
END
EQUATION OF STATE:
Density = rho1 [kg m^-3]
Molar Mass = 18.02 [kg kmol^-1]
Option = Value
END
REFERENCE STATE:
Option = Specified Point
Reference Pressure = 1 [atm]
Reference Specific Enthalpy = 0.0 [J/kg]
Reference Specific Entropy = 0.0 [J/kg/K]
Reference Temperature = 25 [C]
END
REFRACTIVE INDEX:
Option = Value
Refractive Index = 1.0 [m m^-1]
END
SCATTERING COEFFICIENT:
Option = Value
Scattering Coefficient = 0.0 [m^-1]
END
SPECIFIC HEAT CAPACITY:
Option = Value
Specific Heat Capacity = 4181.7 [J kg^-1 K^-1]
Specific Heat Type = Constant Pressure
END
THERMAL CONDUCTIVITY:
Option = Value
Thermal Conductivity = 0.6069 [W m^-1 K^-1]
END
THERMAL EXPANSIVITY:
Option = Value
Thermal Expansivity = 2.57E-04 [K^-1]
END
END
END
END


CCl of whole CFX Analysis:

&replace FLOW: Flow Analysis 1
ANALYSIS TYPE:
Option = Transient
EXTERNAL SOLVER COUPLING:
Option = None
END
INITIAL TIME:
Option = Automatic with Value
Time = 0 [s]
END
TIME DURATION:
Option = Total Time
Total Time = 0.01 [s]
END
TIME STEPS:
Option = Timesteps
Timesteps = 0.0001 [s]
END
END
DOMAIN: Disc
Coord Frame = Coord 0
Domain Type = Immersed Solid
Location = B1179
BOUNDARY: Disc Default
Boundary Type = WALL
Interface Boundary = Off
Location = F1180.1179,F1181.1179,F1182.1179,F1183.1179,F1184. 1179,F1185.1179
END
DOMAIN MODELS:
DOMAIN MOTION:
Option = Stationary
END
END
END
DOMAIN: Mud
Coord Frame = Coord 0
Domain Type = Fluid
Location = B1824
BOUNDARY: IN
Boundary Type = INLET
Coord Frame = Coord 0
Interface Boundary = Off
Location = F2001.1824
BOUNDARY CONDITIONS:
FLOW DIRECTION:
Option = Normal to Boundary Condition
END
FLOW REGIME:
Option = Subsonic
END
HEAT TRANSFER:
Option = Static Temperature
Static Temperature = 300 [K]
END
MASS AND MOMENTUM:
Mass Flow Rate = 10 [kg s^-1]
Option = Mass Flow Rate
END
TURBULENCE:
Option = Medium Intensity and Eddy Viscosity Ratio
END
END
END
BOUNDARY: Mud Default
Boundary Type = WALL
Coord Frame = Coord 0
Create Other Side = Off
Interface Boundary = Off
Location = F2002.1824,F2003.1824
BOUNDARY CONDITIONS:
HEAT TRANSFER:
Option = Adiabatic
END
MASS AND MOMENTUM:
Option = No Slip Wall
END
WALL ROUGHNESS:
Option = Smooth Wall
END
END
END
BOUNDARY: OUT
Boundary Type = OUTLET
Coord Frame = Coord 0
Interface Boundary = Off
Location = F2000.1824
BOUNDARY CONDITIONS:
FLOW REGIME:
Option = Subsonic
END
MASS AND MOMENTUM:
Option = Average Static Pressure
Pressure Profile Blend = 0.05
Relative Pressure = 0 [Pa]
END
PRESSURE AVERAGING:
Option = Average Over Whole Outlet
END
END
END
DOMAIN MODELS:
BUOYANCY MODEL:
Option = Non Buoyant
END
DOMAIN MOTION:
Option = Stationary
END
MESH DEFORMATION:
Option = None
END
REFERENCE PRESSURE:
Reference Pressure = 1 [atm]
END
END
FLUID DEFINITION: Fluid 1
Material = Water
Option = Material Library
MORPHOLOGY:
Option = Continuous Fluid
END
END
FLUID MODELS:
COMBUSTION MODEL:
Option = None
END
HEAT TRANSFER MODEL:
Include Viscous Work Term = On
Option = Total Energy
END
THERMAL RADIATION MODEL:
Option = None
END
TURBULENCE MODEL:
Option = k epsilon
END
TURBULENT WALL FUNCTIONS:
High Speed Model = Off
Option = Scalable
END
END
INITIALISATION:
Coord Frame = Coord 0
Option = Automatic
INITIAL CONDITIONS:
Velocity Type = Cartesian
CARTESIAN VELOCITY COMPONENTS:
Option = Automatic with Value
U = 0 [m s^-1]
V = 0 [m s^-1]
W = 0 [m s^-1]
END
STATIC PRESSURE:
Option = Automatic with Value
Relative Pressure = 0 [Pa]
END
TEMPERATURE:
Option = Automatic with Value
Temperature = 300 [K]
END
TURBULENCE INITIAL CONDITIONS:
Option = Medium Intensity and Eddy Viscosity Ratio
END
END
END
END
DOMAIN: Rotor
Coord Frame = Coord 0
Domain Type = Immersed Solid
Location = B1333
BOUNDARY: Rotor Default
Boundary Type = WALL
Interface Boundary = Off
Location = F1334.1333,F1335.1333,F1906.1333,F1907.1333,F1908. 1333,F1909.1333,F1910.1333,F1911.1333
END
DOMAIN MODELS:
DOMAIN MOTION:
Angular Velocity = 1500 [rev min^-1]
Option = Rotating
AXIS DEFINITION:
Option = Coordinate Axis
Rotation Axis = Coord 0.1
END
END
END
END
DOMAIN: Stator
Coord Frame = Coord 0
Domain Type = Immersed Solid
Location = B1691
BOUNDARY: Stator Default
Boundary Type = WALL
Interface Boundary = Off
Location = F1958.1691,F1959.1691,F1960.1691,F1961.1691,F1962. 1691,F1963.1691,F1964.1691,F1965.1691,F1966.1691,F 1967.1691,F1968.1691,F1969.1691,F1970.1691,F1971.1 691
END
DOMAIN MODELS:
DOMAIN MOTION:
Option = Stationary
END
END
END
OUTPUT CONTROL:
MONITOR OBJECTS:
MONITOR BALANCES:
Option = Full
END
MONITOR FORCES:
Option = Full
END
MONITOR PARTICLES:
Option = Full
END
MONITOR POINT: Monitor Point 1
Coord Frame = Coord 0
Expression Value = rho1 [kg m^-3]
Option = Expression
END
MONITOR RESIDUALS:
Option = Full
END
MONITOR TOTALS:
Option = Full
END
END
RESULTS:
File Compression Level = Default
Option = Standard
END
TRANSIENT RESULTS: Transient Results 1 opening
File Compression Level = Default
Option = Standard
OUTPUT FREQUENCY:
Option = Every Timestep
END
END
END
SOLUTION UNITS:
Angle Units = [rad]
Length Units = [m]
Mass Units = [kg]
Solid Angle Units = [sr]
Temperature Units = [K]
Time Units = [s]
END
SOLVER CONTROL:
Turbulence Numerics = First Order
ADVECTION SCHEME:
Option = High Resolution
END
CONVERGENCE CONTROL:
Maximum Number of Coefficient Loops = 10
Minimum Number of Coefficient Loops = 1
Timescale Control = Coefficient Loops
END
CONVERGENCE CRITERIA:
Residual Target = 1.E-4
Residual Type = RMS
END
IMMERSED SOLID CONTROL:
BOUNDARY MODEL:
Option = None
END
END
TRANSIENT SCHEME:
Option = Second Order Backward Euler
TIMESTEP INITIALISATION:
Option = Automatic
END
END
END
END

Last edited by fresty; November 22, 2014 at 07:54. Reason: adding the whole analysis CCL
fresty is offline   Reply With Quote

Old   November 23, 2014, 18:06
Default
  #7
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,862
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You did not include the definition of rho1 in your CCL.

I do not know what you are modelling, but a common way to do water hammer modelling is to have a domain which is initially at rest and have a boundary condition which suddenly starts the flow. This is very simple to do, much simpler than immersed solids. But if you want to model the detail of the valve opening process you might need something like immersed solids to model it.
ghorrocks is offline   Reply With Quote

Old   November 24, 2014, 10:51
Default
  #8
Senior Member
 
Join Date: Aug 2014
Location: UK
Posts: 213
Rep Power: 13
fresty is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
You did not include the definition of rho1 in your CCL.

I do not know what you are modelling, but a common way to do water hammer modelling is to have a domain which is initially at rest and have a boundary condition which suddenly starts the flow. This is very simple to do, much simpler than immersed solids. But if you want to model the detail of the valve opening process you might need something like immersed solids to model it.
I am sorry I forgot pasting it here:

rho1 = ave(density)@Mud/(1-(ave(p)@IN-ave(p)@IN)/2150000000[N m^-2]) [kg m^-3]
Using simply,
ρ1 = ρ0 / (1 - (p1 - p0) / E)
which I learnt from one of your posts in a related thread.

I guess it is much better if i try and explain the attempt. As you mentioned, i am trying to model the detail of valve opening. I aim to compute the magnitude (differential) of pressure pulse generated by the closure of valve (flow interruption due to a rotating body to be more precise, as the application is in a hydraulic turbine) and in-turn this pulse is intended to act as a trigger force on a spring (placed somewhere in the beginning of the fluid field).
I have considered transient analysis, immersed bodies (both rotor & stator) and hoping to catch a pulse with extremely tiny time steps.
Would welcome the approach you mentioned which i presume is 'mesh displacement/motion' of fluid domain? Would it be an alternative to the above mentioned as the objective is to calculate the travelling pressure pulse wave magnitude w.r.t rotating body orientation.





Appreciate your help.
Cheers.
fresty is offline   Reply With Quote

Old   November 24, 2014, 17:20
Default
  #9
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,862
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
How are you going to get wave effects when you are defining a material which is constant density across the domain (even if it does vary in density over time)?

The correct definition of rho1 is:
rho1 = density_ref/(1-(p-p_ref)/2150000000[N m^-2])

This will return a density field which will allow capture of wave effects. You will also need to define density_ref as the reference density, and p_ref as the reference pressure at which the reference density applies.

If the gizmo you describe just does rotary motion then use rotating frames of reference with GGI interfaces to model the valve.
ghorrocks is offline   Reply With Quote

Old   December 2, 2014, 06:36
Default partial close water hammer effect
  #10
New Member
 
Mohamad55
Join Date: Dec 2014
Posts: 1
Rep Power: 0
mohamad55 is on a distinguished road
Hi Glenn,
I'm working on a model similar to the above one provided by "fresty"
the only difference is that I don't have full closet position, I'm making the design to get only 25% of the full flow area at the closet position,
Please can you help me in the following questions:
1- what is the difference between partial close and full close while studding the water hammer effect using Ansys,
2-in the full close valve there is a pressure wave travel through the pipe and return to valve after the full close of the valve ( with time t=2*L/c), so that wave will return to the valve position in the case of partial close?
3-I did all the instructions mentioned in your previous comments , using the density formulas "1000 [kg m^-3]/(1-(p-101325[N m^-2])/2150000000[N m^-2])" , define both rotor and stator as a fluid domain ,select a rotation domain for the rotor and select mesh connect as GCi...note that I'm using pressure inlet ( on the rotor) and mass flow rate outlet on the rotor,
I'm expecting to get a pressure peak every rotation ( when i get the min flow area), but what i got is damping sinusoidal pressure wave as per below picture,( there is any difference at the partial close position note that at zero time step the valve is full open),
Please can you help in the above issue,

http://WDMyCloud.device1209309.wd2go...6291bfdbab3c65
mohamad55 is offline   Reply With Quote

Old   December 2, 2014, 18:54
Default
  #11
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,862
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
1) Isn't it obvious? If you fully close then the flow stops, if you partially close it just slows down. Both are transients, but of different degrees.
2) If you have a small density change over your pressure wave then the speed of sound is just about independent of the magnitude of the pressure change. So the time is unchanged. If the density change is large then the acoustic velocity changes significantly.
3) The response you show is a function of your entire model. I cannot debug anything just based on that.
ghorrocks is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile calcMassFlowC aurore OpenFOAM Programming & Development 13 March 23, 2018 08:43
[OpenFOAM] Native ParaView Reader Bugs tj22 ParaView 270 January 4, 2016 12:39
UDF: DEFINE_CG_MOTION for vertical jump motion of an electrode! alban Fluent UDF and Scheme Programming 2 June 8, 2010 19:54
erros when compiling simpleSRFFoam examosty OpenFOAM Installation 12 April 26, 2010 19:53
a question of open ".cas" and ".dat" files fanzhong Meng FLUENT 4 May 15, 2006 12:40


All times are GMT -4. The time now is 16:18.