CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Volumetric heat source from dense point cloud (https://www.cfd-online.com/Forums/cfx/198698-volumetric-heat-source-dense-point-cloud.html)

fabio moretti February 15, 2018 05:14

Volumetric heat source from dense point cloud
 
Hi All,

(I apologize in advance if what I'm about to ask has already been addressed in other threads: I've actually made a search over the forum, but I may have missed something relevant.)

I'm setting up a CFX CHT simulation. The problem involves a volumetric power source non-uniformly distributed over the solid domain. Information is to be loaded into a 3D interpolating user function from a rather dense 3D point cloud (namely a csv file with [X, Y, Z, Power] fields and around 1M entries).
1st issue: with such a large number of points, once the user function has been created CFX-Pre gets stuck when writing out a def file.
2nd issue: even with far smaller numbers of points (e.g. 10k), the interpolation operations (being them performed at every time-step) heavily impact on the computing time, thus making the simulation very inefficient.
My question: is there an alternate way to efficiently exploit the point cloud to set a volumetric source? Perhaps via FORTRAN?
Sub-question: would having a point cloud already mapped onto the domain's nodes be of some help?

Thanks a lot for any possible hints.

Fabio

Gert-Jan February 16, 2018 02:43

For a case where I needed UV light intensity, I defined a User Function called Intensity. In this User Function I read 130.000 points (x,y,z,I) from a .csv-file without problems. Then I defined an additional variable as an algebraic equation with value Intensity(x,y,z), which gave me a beautiful intensity in 3D. I used this intensity to determine the dose that Particles collected on their way through the 3D field. I think this resembles your case, but I hardly noticed any effect on computer performance.

1) Did you do exactly the same?
2) Can you describe the power distribution with CEL-Functions? Or is it far too complex?
3) Certainly it depends on the resource you have. Is your computer really slow?

When I read in 130.000 points, I get a Warning. It says that to improve performance, it is recommended to modify the data such, that it can be imported as a Profile Data file. I ignored this warning and CFX continues without problems. Possibly you hit a limit. Did you consider this option?

fabio moretti February 19, 2018 05:15

Thanks Gert-Jan for your focused feedback.

Here are my answers:

1)
No, I didn't define any additional variable. I defined a User Function "power(x,y,z)" from a .csv (the point cloud), then I defined an Expression as "fpower = power(x,y,z)", then I set a volumetric power source as "fpower" over a subdomain.
After your comment, I also tried using an additional variable defined by an algebraic equation (i.e. = "power"), but I got no improvement.

2)
I cannot exclude that, as I haven't done yet a careful analysis of that distribution. But I expect that it would hardly be expressed by simple CEL functions. Moreover, it would be preferable to set up a generally applicable procedure.

3)
I'm using a rather powerful machine.

As I wrote before ("2nd issue"), I am experiencing degraded performance already with 10'000 points.
However, I forgot to say that the tests I run involved a solid domain only (just heat conduction). Of course the relative impact of interpolation on a CHT run (heat conduction + NS + turbulence...) performance would be less severe. I am going to make further tests about that.

Gert-Jan February 19, 2018 05:38

Hi Fabio,

I alse wrote:

"When I read in 130.000 points, I get a Warning. It says that to improve performance, it is recommended to modify the data such, that it can be imported as a Profile Data file. I ignored this warning and CFX continues without problems. Possibly you hit a limit. Did you consider this option?"

Did you also get this message/warning? Will you consider this "Profile Data file" approach?

Regs, Gert-Jan

fabio moretti February 19, 2018 05:54

Sorry, I should have answered on that point too. I was in a hurry...

Well yes, I got that message too. Initially I had dropped that option because I thought it applies only when dealing with boundaries. But I was wrong: I've just found out that one may also do the "Initialize profile data" thing also for a 3D data set and use it to define a volumetric source. The data will not be loaded in CFX-Pre and then stored in the .def, rather the .def will include just a link to the .csv, and the data will be loaded by the Solver when the run is launched. So, there's an advantage in terms of .def file handling. However, you don't gain anything in terms of computing performance, because the interpolation keeps being performed at each time step.

Another way to work around the problem with file.def saving (in case all the cloud is stored there), is to "manually" edit a CCL file and then update the .def by the command cfx5cmds.

Thanks again, Gert-Jan, for your help.

fabio moretti May 9, 2019 11:04

Hi everyone.



After over one year spent doing other stuff, now I've just got back to that unresolved issue.


I have a 15 M nodes CFD CHT model (roughly half in the solid domain), and a 1M points cloud, representing a constant volumetric power source to be mapped onto the solid domain.
Every iteration (outer loop or coefficient loop) lasts a few minutes on the best machine available to me (say 10 cores on a good Xeon workstation), while waiting for HPC resources to become available.



I run some tests, which showed that:


- with the pseudo-steady-state solver, the interpolation function is called at every iteration; compared to a test with algebraic source (no interp), the increase in computing time is as large as 40%;



- with the trantient solver, the interpolation is performed at the beginning of every time step, and still has a considerable impact.



I still believe that it would be nice if I were allowed to have the interpolation done only once, at the beginning of both a steady-state simulation and a transient one (to represent a source, of a BC, that is constant over time).
But I do not know if there is a way to work it out.


So, any hints would be much appreciated! Thanks in advance.

ghorrocks May 9, 2019 18:12

I think your first post was heading in the right direction - if the built in interpolation functions are not working for you then write your own using User Fortran.

fabio moretti May 10, 2019 04:10

...which I would have already tried to do if I were familiar enough with user Fortran, and if those who provide ANSYS technical assistance in Italy hadn't discouraged me (they said it wouldn't help - I am not quite convinced though).


If the project time and budget limitations allow me, then I will try to go that way.


Thanks for you reply.

Gert-Jan May 10, 2019 04:14

When using 3D point cloud, I sometimes noticed a huge difference in calculation time between a case starting from scratch (fast) and a continued calculation (deadly slow). Don't know why, but maybe you observed the same behaviour?

fabio moretti May 10, 2019 04:46

As you point that out, I realize that I might have observed that too. Not sure, though. I'll check if possible and let you know. Thanks.


All times are GMT -4. The time now is 08:59.