Additional setup examples #118
-
Hello Dr. Lehmann, are you willing to share some additional setup examples? Thanks in adavance |
Beta Was this translation helpful? Give feedback.
Answered by
ProjectPhysX
Oct 16, 2023
Replies: 1 comment 1 reply
-
Hi @rakueEP, good news! I could recover both of these ancient setup scripts from my backups. For the honey coiling setup you need to switch to the TRT operator in Have fun! Regards, void main_setup() { // honey coiling; required extensions in defines.hpp: TRT instead of SRT, FP16S, VOLUME_FORCE, SURFACE, INTERACTIVE_GRAPHICS
// ################################################################## define simulation box size, viscosity and volume force ###################################################################
LBM lbm(64u, 64u, 192u, 10.0f, 0.0f, 0.0f, -0.0005f);
// ###################################################################################### define geometry ######################################################################################
const uint Nx=lbm.get_Nx(), Ny=lbm.get_Ny(), Nz=lbm.get_Nz(); parallel_for(lbm.get_N(), [&](ulong n) { uint x=0u, y=0u, z=0u; lbm.coordinates(n, x, y, z);
const uint R=10u, H = Nz/4u;
if(z==0&&sq(x-Nx/2u)+sq(y-Ny/2u)>sq(R)) lbm.flags[n] = TYPE_S;
else if(z<H) lbm.flags[n] = TYPE_F;
if(x==0u||x==Nx-1u||y==0u||y==Ny-1u) lbm.flags[n] = TYPE_S; // x and y non periodic
}); // ####################################################################### run simulation, export images and data ##########################################################################
lbm.graphics.visualization_modes = lbm.get_D()==1u ? VIS_PHI_RAYTRACE : VIS_PHI_RASTERIZE;
lbm.run();
} /**/ void main_setup() { // eternal periodic fountain; required extensions in defines.hpp: FP16S, VOLUME_FORCE, SURFACE, INTERACTIVE_GRAPHICS
// ################################################################## define simulation box size, viscosity and volume force ###################################################################
//LBM lbm(96u, 192u, 128u, 0.02f, 0.0f, 0.0f, -0.001f, 0.01f);
LBM lbm(96u, 192u, 128u, 0.02f, 0.0f, 0.0f, -0.001f);
// ###################################################################################### define geometry ######################################################################################
const uint Nx=lbm.get_Nx(), Ny=lbm.get_Ny(), Nz=lbm.get_Nz(); parallel_for(lbm.get_N(), [&](ulong n) { uint x=0u, y=0u, z=0u; lbm.coordinates(n, x, y, z);
if(y>Ny*5/6) lbm.flags[n] = TYPE_F;
const uint D = max(Nx, Nz);
const uint r = D/6;
if(x==0||x==Nx-1) lbm.flags[n] = TYPE_S; // x non periodic
if(y==0||y==Ny-1) lbm.flags[n] = TYPE_S; // y non periodic
if((z==0||z==Nz-1) && sq(x-Nx/2)+sq(y-Nx/2)>sq(r)) lbm.flags[n] = TYPE_S; // z non periodic
//if(y<=Nx/2+2*r && torus_x(x, y, z, float3(Nx/2, Nx/2+r, Nz), r, r)) lbm.flags[n] = TYPE_S;
//if(y<=Nx/2+r && torus_x(x, y, z, float3(Nx/2, Nx/2+r, Nz), r, r)) lbm.flags[n] = TYPE_S;
//if(conepipe(x, y, z, float3(Nx/2, Nx/2+2*r, Nz-r), float3(0u, 2u*r, 0u), r, r/4)) lbm.flags[n] = TYPE_S;
if(pipe(x, y, z, float3(Nx/2, Nx/2, Nz-2*r), float3(0u, 0u, 4*r), r)) lbm.flags[n] = TYPE_S;
if(z<=Nz-4*r && torus_x(x, y, z, float3(Nx/2, Nx/2+r, Nz-4*r), r, r)) lbm.flags[n] = TYPE_S;
if(conepipe(x, y, z, float3(Nx/2, Nx/2+2*r, Nz-r*7/2), float3(0u, 0u, r), r, r/3)) lbm.flags[n] = TYPE_S;
//if(pipe(x, y, z, float3(Nx/2, Nx/2+2*r, Nz-r*3), float3(0u, 0u, 2*r), r)) lbm.flags[n] = TYPE_S;
//if((z>=Nz-2*r) && torus_x(x, y, z, float3(Nx/2, Nx/2+3*r, Nz-2*r), r, r)) lbm.flags[n] = TYPE_S;
}); // ####################################################################### run simulation, export images and data ##########################################################################
lbm.graphics.visualization_modes = VIS_FLAG_LATTICE|VIS_STREAMLINES;
lbm.run();
} /**/ |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
rakueEP
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @rakueEP,
good news! I could recover both of these ancient setup scripts from my backups. For the honey coiling setup you need to switch to the TRT operator in
defines.hpp
.Have fun!
Regards,
Moritz