CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Could temperature/density profile (of discrete data not a function) be used at inlet? (https://www.cfd-online.com/Forums/cfx/131314-could-temperature-density-profile-discrete-data-not-function-used-inlet.html)

hwangpo March 13, 2014 02:16

Could temperature/density profile (of discrete data not a function) be used at inlet?
 
Hey there,

Does it possible to use B.C. like discrete data in CFX?
I modeled a thermal stratified reservoir in which temperature and density profiles are function of elevation, and now I would like to use dicrete points instead of the fitted curve in a similiar CFD model. How can I use it?

Thanks a lot.

PeMo March 13, 2014 03:00

This can be done via Fortran and Junction Box routine. Read chapter 18.8 in the Modeling Guide for how to read in table data and create a profile boundary

hwangpo March 13, 2014 05:24

Quote:

Originally Posted by PeMo (Post 479689)
This can be done via Fortran and Junction Box routine. Read chapter 18.8 in the Modeling Guide for how to read in table data and create a profile boundary

thank u so much

mvoss March 13, 2014 05:43

You can also read in datatables to a function and use this function for a b.c. in CFX Pre directly.
Also check "2.9. Profile Boundary Conditions" in CFX/the Modeling Guide

hwangpo March 13, 2014 06:27

Quote:

Originally Posted by mvoss (Post 479727)
You can also read in datatables to a function and use this function for a b.c. in CFX Pre directly.
Also check "2.9. Profile Boundary Conditions" in CFX/the Modeling Guide

Yep.
Thank u very much.
This is more useful for me as I do not know anything about Fortran.
I am going in this way.
Anyway, I will learn Fortran later.

hwangpo March 13, 2014 07:47

Quote:

Originally Posted by mvoss (Post 479727)
You can also read in datatables to a function and use this function for a b.c. in CFX Pre directly.
Also check "2.9. Profile Boundary Conditions" in CFX/the Modeling Guide

hey, Matthias Voß
Could you tell that in detail please?
I've learned 'Profile Boundary Conditions', and still do not know what to do. Here is my problem: at INLET B.C., I have temperature, density and pressure varying with elevation/depth, which is nothing to do with (x, y); the profile of INLET exported from cfd-post contains points (x, y, z, ...) which is not consistent with my experiment data (my profiles just vary with z). How can I cope with this issue? I am thinking about providing all the measured points by hand, but I do not know what to do with x and y-position.
Thank you very much for your time.

mvoss March 13, 2014 08:40

When setting up the function you can copy/paste a large set of points into the schematic. So you need to provide density/temp/pressure wrt. z and use that function for all 3 components- since x,y are independent you can feed in your func(z) and get a profile wrt. z.
Maybe you can provide a small setup-case or a pic. if i am getting you wrong.

hwangpo March 13, 2014 09:05

Quote:

Originally Posted by mvoss (Post 479770)
When setting up the function you can copy/paste a large set of points into the schematic. So you need to provide density/temp/pressure wrt. z and use that function for all 3 components- since x,y are independent you can feed in your func(z) and get a profile wrt. z.
Maybe you can provide a small setup-case or a pic. if i am getting you wrong.

Yep. You are absolutely right about the function method and I used it in that way before. Yet I am thinking about using profile B.C. instead of a function this time because the discrete data cannot be fitted well as a suitable function.

So I am thinking if it is possible to use profile B.C.(making my own B.C. file) to provide the infomation. And I am confused with how to create the B.C. profile(including discrete data not a function) because I do not have lots of spatial points with which the CFX solver to interpolate.
Thank u so much.

mvoss March 13, 2014 10:07

i donīt get it...

assume you have a User Function called "test" with Option "Interpolation(Data Input)" with argument Units [m] and Result Units [C] and the following discrete data set
Code:

0  10
5  15
10  10
15  5
20  20

and you create an Expression "mytestfunc" with test(x)
and then you plot the expression (which is the same as using it as a bc-profile/initial value) you get a zig-zag line.
Between the points there will be a linear interpolation.
If you want to get real steps you just add e.g.
Code:

1e-6 15
and you can produce VERY discrete functions. Even if your data is discrete you need to provide data in between.

OR create a sufficient function f(x) with higher order terms (e.g 5 --> ECXEL, MatLAB) from the given discrete data to smooth between your discrete data and use the mathematical function in the expression for the bc with z being your z-coordinate (test for division by 0 and clip between a min/max 1e-8 - 1e15 just to be sure nothing goes out of bounds).

hwangpo March 13, 2014 10:27

Quote:

Originally Posted by mvoss (Post 479802)
i donīt get it...

assume you have a User Function called "test" with Option "Interpolation(Data Input)" with argument Units [m] and Result Units [C] and the following discrete data set
Code:

0  10
5  15
10  10
15  5
20  20

and you create an Expression "mytestfunc" with test(x)
and then you plot the expression (which is the same as using it as a bc-profile/initial value) you get a zig-zag line.
Between the points there will be a linear interpolation.
If you want to get real steps you just add e.g.
Code:

1e-6 15
and you can produce VERY discrete functions. Even if your data it discrete you need to provide data in between.

OR create a sufficient function f(x) with higher order terms (e.g 5 --> ECXEL, MatLAB) from the given discrete data to smooth between your discrete data and use the mathematical function in the expression for the bc with z being your z-coordinate (test for division by 0 and clip between a min/max 1e-8 - 1e15 just to be sure nothing goes out of bounds.

I really appreciate your help. I will follow your suggestion (resort to User Function with option 'Interpolation') and check this soon.
Thank you so much for your kindness.


All times are GMT -4. The time now is 11:46.