Skip to content

Velocity perturbations using random number generator in bcnormal() function for GPU #760

Closed Answered by eskimmel
eskimmel asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, thanks for the response. My domain uses a development region, so I really just need velocity perturbations to trigger some instabilities to allow turbulence to form naturally within the development region. I was able to solve my problem, so I thought I would write my solution method on here for anyone who runs into a similar issue.

I used cuRAND to generate the random numbers at my inlet. In bcnormal, I used the following lines with curand.h and curand_kernel.h in the header:

curandState s;
int seed = floor(abs(10000000.0 * a_time * x[1] * x[2]) + 25) ; (to create a different seed at every inlet cell)
curand_init(seed, 0, 0, &s);
amrex::Real random_number = curand_uniform(&s);
amrex::…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@eskimmel
Comment options

Answer selected by marchdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants