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

How to use CFX own variables in user formulai

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By ghorrocks
  • 1 Post By Opaque

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 10, 2019, 12:32
Default How to use CFX own variables in user formulai
  #1
Member
 
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7
Goenitz is on a distinguished road
Hi

I would like to use CFX variables like temperature, density, mass fraction, thermal conductivity.

For example, expression is Mass flux=100*T*Random (suppose) T being the temperature at that surface, line or point.
So can I write in CEL expression for fluid flux like that at wall (as boundary condition) as it is?
e.g.
LIBRARY:
CEL:
EXPRESSIONS:
MassFlux=100*T*Random (or 100*temperature*Random)
END
END
END

LIBRARY:
CEL:
EXPRESSIONS:
Random=0.00007 [kg m^-2 s^-1 K^-1]
END
END
END
and CFX will incorporate temperature into this expression calculated by its solver?
Thanx

Last edited by Goenitz; June 10, 2019 at 13:57. Reason: explanation
Goenitz is offline   Reply With Quote

Old   June 10, 2019, 18:49
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
As long as the units check out CFX will use it. But why didn't you just try this in CFX and find out for yourself?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is online now   Reply With Quote

Old   June 10, 2019, 20:06
Default
  #3
Member
 
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7
Goenitz is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
As long as the units check out CFX will use it. But why didn't you just try this in CFX and find out for yourself?
I tried and Total temperature keep diverging... w/o this boundary condition, simulation works fine. However, it works till 10 iteration so I can see that expression takes T values and increase/decease mass flux at that boundary. But as solution is not converged, so I cannot say definitely.
Goenitz is offline   Reply With Quote

Old   June 11, 2019, 07:33
Default
  #4
Member
 
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7
Goenitz is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
As long as the units check out CFX will use it. But why didn't you just try this in CFX and find out for yourself?
Anyway, I am more interested if actually it takes temperature value by this simple expression.

I took inspiration from tutorial 16 'reacting flow in mixing tube'. It had expressions like this.
But I have less faith as when I did tutorial 21 'Combustion in can...', I changed reaction rates to zero but it didn't effect on combustion process.
Goenitz is offline   Reply With Quote

Old   June 11, 2019, 19:53
Default
  #5
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Getting CFX to accept an expression and use it is a different thing to it being numerically stable and you being able to get a converged solution. It is hard to see a physical process where the flow rate is proportional to the temperature, and non-physical processes often lead to simulations which do not converge.

So the question is whether the mass flow rate condition you propose is appropriate.
Goenitz likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is online now   Reply With Quote

Old   June 12, 2019, 09:24
Default
  #6
Member
 
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7
Goenitz is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
Getting CFX to accept an expression and use it is a different thing to it being numerically stable and you being able to get a converged solution. It is hard to see a physical process where the flow rate is proportional to the temperature, and non-physical processes often lead to simulations which do not converge.

So the question is whether the mass flow rate condition you propose is appropriate.
yes, the mass flow condition wasn't appropriate so solution was diverging.
I want to set a boundary condition of Temperature on wall. it is ∂T/∂y=-(∑RHi)/λ. (R reaction rate, H enthalpy, λ thermal conductivity, w mass fraction, i specie)
λ=∑wi*λi (I have CH4,CO2, H2O,... as species) So i defined the following.

ThermCond=CH4.mf*CH4.cond+CO2.mf*CO2.cond+CO.mf*CO .cond+H2.mf*H2.cond+H2O.mf*H2O.cond+N2.mf*N2.cond

1. is that correct way as CFX is not recognising it.
2. How can I assign expression ∂T/∂y on a fixed wall temperature option? is that legit?
Attached Files
File Type: txt ReactorExpressions.txt (909 Bytes, 4 views)
Goenitz is offline   Reply With Quote

Old   June 12, 2019, 13:55
Default
  #7
Senior Member
 
Join Date: Jun 2009
Posts: 1,804
Rep Power: 32
Opaque will become famous soon enough
It seems you are trying to impose a heat flux proportional to the reaction rate at the boundary, i.e.

q = - k dT/dn @boundary = Sum over i (H_i * R_i)

There is no need for the thermal conductivity of the mixture since CFX computes it if needed, neither the temperature gradient.

The only time both of those quantities are needed (K and dT/dn) is when backing out the boundary temperature once the equations are solved.

On the boundary of interest, select Heat Flux in, set the Heat Flux parameter to an expression equal to the summation on the RHS of the equation above.

The solution may tend to diverge if you use a large timescale, so reduce it until it converges. If you are successful at it, let us know.
Goenitz likes this.
Opaque is offline   Reply With Quote

Old   June 17, 2019, 09:03
Default
  #8
Member
 
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7
Goenitz is on a distinguished road
Quote:
Originally Posted by Opaque View Post

If you are successful at it, let us know.
Hi,

No Success yet as there are other problems. But even forcing Flux as your suggested expression, doesn't work.

My expression is:
LIBRARY:

CEL:

EXPRESSIONS:

Arr= 390 [mol kg^-1 s^-1 Pa^-0.47]

Eact = 43200 [J mol^-1]

kconst=Arr*((CH4.p)^0.46)*((H2O.p)^0.01)

Rate= kconst* e^(-Eact/R/T)

END

END

END

Will the above expression capture T and partial pressure or I have to incorporate AreaAve(CH4.p)@Surface?

Another things is CH4.p for partial pressure is not recognised by CFX so I use CH4.mf*p for time being. Because Dalton Law says CH4.p=CH4.mol/mol_total*p_total.

Going through reference guide, I can say that when user assigns p,T, density etc then these are bulk values.

P.S I assigned Sum over i(H_i*R_i) (Sum over=areaAve=sum) but could not succeed. Actually it can operate one variable e.g. sum(p), sum(T) etc
Error is:

The function 'sum' referenced by parameter 'Heat Flux in' in object '/FLOW:Flow Analysis 1/DOMAIN:Fluid1/BOUNDARY:SinkF1/BOUNDARY CONDITIONS/HEAT TRANSFER' has an invalid argument, 'new'. Only arguments that consist of a single recognised variable name are supported by the solver.

Last edited by Goenitz; June 17, 2019 at 11:24.
Goenitz is offline   Reply With Quote

Old   June 20, 2019, 07:55
Default
  #9
Member
 
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7
Goenitz is on a distinguished road
Quote:
Originally Posted by Opaque View Post

If you are successful at it, let us know.
Though I am not successful converting gradients into flux , but the code is working.
Goenitz is offline   Reply With Quote

Reply


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
How to get multiple outputs from CFX user routine doublestrong CFX 7 April 11, 2017 11:25
CFX user ID error. Plz Help. Zedd CFX 1 March 14, 2017 08:05
HELP PLEASE! How to plot Time-Averaged variables in CFX??? RobBanks CFX 7 September 29, 2016 01:32
How to set environmental variables of Intel Fortran +CFX? Christine MO CFX 0 September 23, 2011 11:11
CFX User Subroutine Archive David Creech Main CFD Forum 0 March 17, 1999 12:41


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