CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   BC profile with non-standard variables (https://www.cfd-online.com/Forums/cfx/22259-bc-profile-non-standard-variables.html)

Philipp March 6, 2006 04:12

BC profile with non-standard variables
 
Hello,

I would like to define the inlet BC by a profile that is in .csv format. The thing is that the variable of my profile is mass-flux [kg s^-1 m^-2], which is a non-standard variable in Ansys-CFX10.0. I read in the R10 Modelling manuals (p.81) that this is in general possible. In fact, I can "Initialise Profile Data" correctly, i.e. without error message. Next, I select for my inlet BC "Use Profile Data" and click on "Generate Values" as it is written in the manuals. Unfortunately, the "Boundary Details" Panel remains unchanged, i.e. I do not get a new field where I could define the profile and variable name, respectively.

I hope somebody has done something similar already and could help me out! Thank you very much!

For completeness, this are the first lines of .csv file:

[Name]

Inlet

[Spatial Fields]

x,y,z

[Data]

x [m],y [m],z [m],mf [kg s^-1 m^-2]

0.0042565162,-0.0012608375,0.0049999999,5766.6665

0.0043166699,-0.0010363408,0.0049999999,5767.2412


Mike March 6, 2006 14:50

Re: BC profile with non-standard variables
 
BC's have to be specified using one of the availale method (mass flow, velocity, total pressure etc). Since you have mass flux data then you just need to multiply it by the area of your inlet so that you can specify a mass flow BC. When you click "Generate Values", all CFX-Pre does is try to fill in the boundary condition fields using your data. Since there is no mass flux BC, then CFX-Pre can't enter the appropriate function for you, so you have to enter it manually. Enter a mass flow boundary condition using an expression such as:

Inlet.mf(x,y,z) * area()@BC_Name

where "Inlet" is the name of the function that was created when you read in the csv file, "mf" is the name of the data field in that function, and BC_Name is your boundary condition name. M

Philipp March 7, 2006 04:09

Re: BC profile with non-standard variables
 
Hi Mike and all other readers,

Thank you for your comment. I did as you have suggested. Unfortunately, I still struggle at some point with the implementation of:

Inlet.mf(x,y,z)*area()@BC_Name

Firstly, it seems that the function 'area()' is not supported in CFXpre, which makes an immediate evaluation of the expression impossible. In detail, I receive following error: "Attempt to evaluate the CEL callback function 'area'. Although it is valid to create an expression that uses such a function, the preprocessor does not support its evaluation." I assume that it should work fine in the solver. If not, I still can replace

area()@BC_Name

by the numerical value (which is available), although it would be less elegant.

Despite of the area-struggle, I have much more problems with the first part of the expression

Inlet.mf(x,y,z)

For testing, I firstly changed the units of 'mf' in my csv file from [kg s^-1 m^-2] to [kg s^-1]. Next, I defined an expression 'myVariable' = Inlet.mf(x,y,z) (-> 'Inlet' = csv file function name, 'mf' = name of data field in this function). In the BC panel, I switched the inlet to 'Mass Flow Rate' and entered the expression 'myVariable'. After hitting 'Apply', I receive following error: "Parameter 'Mass Flow Rate' in Object '/FLOW/DOMAIN:Geometry/Boundary:Inlet 'BOUNDARY CONDITIONS/MASS AND MOMENTUM' has been assigned an expression that contains the following unavailable variables: x,y,z" (please check also my first posting for an example of my csv file).

In a second test, I changed the 'mf' units to [m s^-1] (although it does physically make no sense) and the inlet BC to 'Cart. Vel. Components' with u = v = 0 and w = 'myVariable'. Though, I did the same as before except of these two changes, CFXpre was NOT complaining in the latter approach.

I should also mention that the data of the csv file seems correct as an evaluation of the profile by the plot command in the 'Expression' tab gives reasonable results. Indeed, the two test cases differ only by the unit as one might expect.

Bottom line: for some reason, CFXpre does not like my mass flow profile definition. I have to say, after struggeling now for two days, I come to an end with my ideas. Any comment, suggestions, help on this problem is therefore highly appreciated!

Thanks!

Mike March 7, 2006 13:15

Re: BC profile with non-standard variables
 
Sorry - an error on my part - I don't think you can do a Mass Flow profile. Mass flow is a property of the whole boundary condition and therefore can not be a function of x,y, or z. I think you'll have to obtain/calculate a velocity profile for the boundary. Is the profile from other CFX results, so can you export a velocity profile from CFX-Post, I'm guessing not? M

Robin March 7, 2006 13:20

Re: BC profile with non-standard variables
 
You need to include the element area for the mass flux in your profile as well (which I assume was written from Post). You can then compute the local velocity as:

velocity = mass flux / (area * density)

or

velocity = Inlet.mf(x,y,z) / (Inlet.area(x,y,z) * Density)

Regards, Robin

Philipp March 8, 2006 02:24

Re: BC profile with non-standard variables
 
Thank you both Mike and Robin for your contributions!

Indeed, a velocity profile at the inlet is not an option in this case. Firstly, the data is not based on a previous CFX run. Secondly, the fluid of this high-pressure internal flow problem is treated as slightly compressible (slightly compressible because it is a liquid and not a gas).

If the fluid would have a constant density, I could of course use the velocity option instead as this means that the mass flow is linked to the velocity by a constant parameter (as you both pointed out). I guess may only option is then to use a constant mass flow over the entire boundary and live with the uncertainty.

And just a final remark: I don't know if I don't get the big picture right now, but why is it possible to export a mass flow profile from CFXpost when I cannot import the same again in CFXpre? Does everything have to be incompressible?

Thanks again big times for your views!

kake March 16, 2006 01:40

Re: BC profile with non-standard variables
 
sure,please open the file,then correct all the variable is the same(including the word size )

by the way,you can use cel instead。


All times are GMT -4. The time now is 15:30.