CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Multiple user defined scalars (https://www.cfd-online.com/Forums/fluent/28344-multiple-user-defined-scalars.html)

Hassid Samuel March 23, 2001 08:04

Multiple user defined scalars
 
In a problem in which more than one user defined scalar is used, is there any possibility if we use in the process of the calculation of the source term associated with each scalar the same function to circumvent the computer-time-consuming calculation of a part of the source term by using an array which is calculated once and whose value is transfered to the source term of the other user-defined-scalar equation ?

Greg Perkins March 26, 2001 20:00

Re: Multiple user defined scalars
 
The easiest thing to do is define one or more user defined memory locations and store the value(s) of the source term(s) in that, calculated with a define_adjust function.

Then when your source terms are called you can just passs the value stored in the user memory as the source term. This works fine, but of course some additional memory is required.

Thus your calculation loop is called only once per iteration (or less if required) from the define_adjust routine.

If your calc loops are intensive you'll get a good speed-up from this - in my poblem I got around 10x speed-up.

Regards

Greg

Hassid Samuel March 27, 2001 03:05

Re: Multiple user defined scalars
 
Thanks for the answer. I am not sure though - is this way to be used only for the storage of the source terms themselves - or for other terms used in conjunction with source terms ?

Greg Perkins March 27, 2001 03:12

Re: Multiple user defined scalars
 
what do you mean?

you can use memory location to store whatever you want. it depends on your problem. essentially you will have some trade-off of memory vs computation. If you want fast computation, you can store results calculated once and pass them to the source terms as described, or you can repeatedly calculate them to save memory. The amount of memory used for storage is pretty small - remember that Fluent stores just about all variables/properties in this way internally - that's why its uses so much ram as compared to a solver you might write yourself. So using a few udms will not effect memory sigificantly compared to your normal fluent model.

Greg


All times are GMT -4. The time now is 06:42.