CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Giving Random input through field function (https://www.cfd-online.com/Forums/star-ccm/172303-giving-random-input-through-field-function.html)

kamal tewari May 28, 2016 02:58

Giving Random input through field function
 
Hi All

I am modelling noise cancellation in a duct and want to give random inputs through field functions as a (source of noise) is there any method/ command by which I can give random numbers?

marmot May 29, 2016 03:51

you could use user coding or perhaps easier is to generate a table of random numbers and input this table into sccm+, I guess your table will be either or both a function of space and time, than you can create a field function based on the table. For the syntax just search in the help for field function reading tables.

kamal tewari May 31, 2016 01:41

Thanks It worked .

But the problem now I am encountering is while designing a controller. I need to give input based on the output received. Suppose I give a Random Input and I get some output then I need to process this output in Matlab and based on the output from matlab I need to give Input to the Star CCm+ . Could you please tell me how this could be implemented in STAR CCM+..

marmot May 31, 2016 04:34

Complicated way is with a java macro, you run the simulation, stop, write output from sccm+, (somehow the java macro runs matlab, matlap-> output, update the input table in sccm+.

Another way is that you build a lookup table, perhaps you know the range of the output from sccm+, than you run matlab for this range of anticipated output from sccm+, matlab provides a table of results, this is now a table in sccm+. If my explanation did not make sense, just google "Lookup table"

ggulgulia June 7, 2016 23:10

hello,

if the user has the flexibility to create random number from java codes, then the random number generation code block can be embedded in the java macro itself. This will free the user to write another code to couple simulation with MATLAB.


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