FluidX3D icon indicating copy to clipboard operation
FluidX3D copied to clipboard

Artificial temperature diffusion at the solid boundary (TYPE_S)

Open rodionstepanov opened this issue 1 year ago • 0 comments

I took a setup for the thermal convection in 2D and set betta=0. So no buoyancy force. Linear temperature distribution between hot and cold boundaries is expected. But I've found something very different (see attached figure). What is wrong in my code?

void main_setup() { //D2Q9, FP16S,  VOLUME_FORCE, TEMPERATURE
	LBM lbm(1000u, 1000u, 1u, 1u, 1u, 1u, 0.1f, 0.0f, -0.0005f, 0.0f, 0.0f, 0.1f, 0.0f);
	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);
	lbm.rho[n] = units.rho_hydrostatic(0.0005f, (float)y, 0.5f * (float)Ny); // initialize density with hydrostatic pressure
	if (x == 1u) {
		lbm.T[n] = 1.75f;
		lbm.flags[n] = TYPE_T;
	}
	else if (x == Nx - 2u) {
		lbm.T[n] = 0.25f;
		lbm.flags[n] = TYPE_T;
	}
	if (x == 0u || x == Nx - 1u || y == 0u || y == Ny - 1u) lbm.flags[n] = TYPE_S; // all non periodic
		}); 
	lbm.graphics.visualization_modes = VIS_FLAG_LATTICE | VIS_FIELD;
	lbm.graphics.slice_mode = 3;
	lbm.graphics.set_camera_centered(-90.0f, 90.0f, 100.0f, 0.778801f);
	lbm.run();
}

image

rodionstepanov avatar Nov 01 '24 22:11 rodionstepanov