Closed mikehnta00 closed 2 weeks ago
Actually I see now that just using "lbm.u.z[n] = 0.75f; " or something does exactly what I was looking for Hope this helps someone!
Hi @mikehnta00,
there is a very convenient and also physically correct way in place to do this:
VOLUME_FORCE
and FORCE_FIELD
extensions in src/defines.hpp
main_setup()
function as part of the initial conditions, you can set a volume force lbm.F.z[n]
(x or y components analogous) for each cell n
individuallyNo need to pull out and modify the velocity. The TYPE_E
boundaries are only for fixed-velocity boundary conditions.
Kind regards, Moritz
Starting with the "periodic faucet mass conservation test;" I am trying to add a force to the water as it comes out of the z = Nz plane.
Is there a feature or an easy way to add a layer of cells that applies a certain force to the water during simulation?
It seems when you use the SURFACE define it enables UPDATE_FIELDS so rho, u, T are updated in every LBM step.
This might be overriding my attempt, or more likely, I'm not even be accessing the correct data with my additional code in setup.cpp Here is my attempt to add a force to the water:
}); // ############################# run simulation, export images and data ################################### lbm.graphics.visualization_modes = VIS_FLAG_LATTICE|VIS_PHI_RASTERIZE; lbm.run(); const uint D = max(Nx, Nz), R = D / 6; const ulong n = lbm.get_N(); uint x = 0u, y = 0u, z = 0u; lbm.coordinates(n, x, y, z); while (true) { //if inside the force circle, for (int i= 0; i< n; i++) { if (y == Nx/2u+2u*R+5u && sq(x-Nx/2u)+sq(z-(Nz-R))>sq(R)) lbm.u.y[n] = lbm.u.y[n]+0.9f; // add force to the water }; }