CFD Online Logo CFD Online URL
Home > Forums > CFX

additional variable- "sum" function

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

LinkBack Thread Tools Display Modes
Old   December 11, 2007, 11:56
Default additional variable- "sum" function
Posts: n/a
Hi Everyone, I am using CFX 11 package. I want to inject dye only for 2 seconds from domain inlet(already predicted flow field, I turned off the fluid solver from expert parameters, so it is just transport equation of additional variable)and get total concentration curve at the outlet.

Here is the two seconds injection of dye. "DyeMassFlow = (step ((2[s]-t)/ (1[s])))*(1[kg])/(2[s])"

Here is the additional variable. "ADDITIONAL VARIABLE: Dye

Option = Definition

Tensor Type = SCALAR

Units = [kg/s]

Variable Type = Volumetric"

And here is the total concentration at the outlet

"TotalDye = sum(Dye)@Outlet" The problem is I am injecting 1 kg dye as a total, however the total I am geting at the outlet is far more than the value I am injecting.

Can anyone tell me what I am doing wrong? Thanks a lot Regards, Mike

  Reply With Quote

Old   December 11, 2007, 13:37
Default Re: additional variable- "sum" function
Posts: n/a
Hi Mike,

Your scalar units shoud be [kg/m^3] for volumetric or [kg/kg] for specific. Also, the step() function will return 0.5 when the operand is zero, so you may want to write it as (step ((1.9999[s]-t)/ (1[s])))*(1[kg])/(2[s]) so the value at 2 [s] is exactly zero.

If you apply this at the inlet, the dye mass flow rate will be a function of the inlet flow rate (because the flow is transporting it). If you solve it as a specific variable [kg/kg], the dye flow rate will be equal to the dye mass fraction (it's value) times the mass flow rate through the inlet. If you set it up as a volumetric AV, it will be the inlet volume flow rate times the volume fraction (i.e. (mass flow/density)*volume fraction).

Alternatively, you could specify the dye as a source injection at the inlet, as opposed to a value. In this case you would use the function as you have it now and the local concentration will depend on the flow rate.

  Reply With Quote

Old   December 11, 2007, 16:19
Default Re: additional variable- "sum" function
Posts: n/a
Thank you so much,CycLone.

  Reply With Quote

Old   December 11, 2007, 17:25
Default Re: additional variable- "sum" function
Glenn Horrocks
Posts: n/a

Also the "sum" function is not the correct way of getting the amount of AV in a volume or across an interface. The sum function just does a simple sum at all nodes. You should use one of the integrating functions, such as volumeInt() or areaInt(). You might also want to use a mass flow function massflowInt() which integrates against mass flow across an interface rather than the area integral function.

Regards, Glenn
  Reply With Quote

Old   December 12, 2007, 11:22
Default Re: additional variable- "sum" function
Posts: n/a
Thanks a lot, Glenn.
  Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 13:06
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 05:37
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 11:23

All times are GMT -4. The time now is 04:31.