Skip to content

Coriolis force implementation #313

@rodionstepanov

Description

@rodionstepanov

Hi! I wonder is there any more optimal way to model the Coriolis force than rhis

	while (true) { // main simulation loop
		lbm.u.read_from_device();
		for (uint z = 1u; z < Nz - 1u; z++) {
			for (uint y = 1u; y < Ny-1u; y++) {
				for (uint x = 1u; x < Nx - 1u; x++) {
					const uint n = x + (y + z * Ny) * Nx;
					lbm.F.x[n] = -Co * lbm.u.y[n];
					lbm.F.y[n] =  Co * lbm.u.x[n];
					lbm.F.z[n] =  0.0f;
				}
			}
		}
		lbm.F.write_to_device();
		lbm.run(1u);
	}

It slows down a thousand times :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions