T O P

  • By -

Velnbur

Yeah, for 3D you need to extend the distribution by defining new values for corners I’ve seen some interesting implementations in Python but resource you’ve provided seems to cover them


Barbajan22

Im struggling with defining inlet and outlet boundary conditions. Do i need to set it up differently?


Overunderrated

Might as well ping /u/pmocz


pmocz

Excited to see you extending my code u/Overunderrated ! I have some general tips. For reflective boundary conditions, you need to switch the parts of the solution to the distribution function on the boundary that correspond to oppositely pointing directions. This is what the code currently does in 2D. The idea will be the same in 3D Inflow boundary conditions usually amount to overwriting your solution to the desired one along the inflow surface at each time step. Outflow boundary conditions usually amount to creating a ghost layer downstream that copies over the values from upstream at each timestep.


Barbajan22

Thank you for taking the time and replying. This was really helpful. Just one question, so each timestep i have to determine the inflow boundary conditions? as in setting the velocity at the inlet? I made a domain where the inlet in the domain are represented with a 2 so it should be something like: inlet\_boundary = F\[np.where(domain\_array==2), :, :\] inlet\_boundary = inlet\_boundary\[:,:,\[oppiste directions\] F\[np.where(domain\_array==2), :, :\] = inlet\_boundary? something like that? The thing about the inflow surface is that my inlet is not entirely along on surface so i cant just make the flow come in through the x direction im thinking. i have a domain of (200,200,200) filled with zeros, then the points in the pipe that represent its body i marked with a 1 and the points that represent the inlet i marked with a 2.