
[Sponsors] 
May 13, 2010, 10:06 
CFX expression error

#1 
New Member
vin
Join Date: May 2010
Posts: 1
Rep Power: 0 
Hello, everyone
I am newly learner of CFX, recently i study the CFX tutorial example "cavitationini" 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! 

January 23, 2011, 07:50 

#2 
New Member
artemis
Join Date: May 2010
Posts: 8
Rep Power: 8 
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 

January 23, 2011, 20:27 

#3 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 12,638
Rep Power: 98 
The simulations should run fine. It is just the preprocessor saying it cannot evaluate the CEL, but the solver should be OK.


November 13, 2014, 09:48 
similar issues but with material property change..

#4 
Senior Member
Join Date: Aug 2014
Posts: 167
Rep Power: 4 
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. 

November 13, 2014, 18:29 

#5 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 12,638
Rep Power: 98 
Please post your CCL.


November 22, 2014, 07:52 

#6 
Senior Member
Join Date: Aug 2014
Posts: 167
Rep Power: 4 
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.899E4 [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.57E04 [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.E4 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 

November 23, 2014, 18:06 

#7 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 12,638
Rep Power: 98 
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. 

November 24, 2014, 10:51 

#8  
Senior Member
Join Date: Aug 2014
Posts: 167
Rep Power: 4 
Quote:
rho1 = ave(density)@Mud/(1(ave(p)@INave(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 inturn 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. 

November 24, 2014, 17:20 

#9 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 12,638
Rep Power: 98 
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(pp_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. 

December 2, 2014, 06:36 
partial close water hammer effect

#10 
New Member
Mohamad55
Join Date: Dec 2014
Posts: 1
Rep Power: 0 
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, 2in 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? 3I did all the instructions mentioned in your previous comments , using the density formulas "1000 [kg m^3]/(1(p101325[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 

December 2, 2014, 18:54 

#11 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 12,638
Rep Power: 98 
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. 

Thread Tools  
Display Modes  


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