aboutsummaryrefslogtreecommitdiff
path: root/src/lbm.h
blob: 96348c11afaead20be2f0f46b53704d42dfa766d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include "data_cell.h"
#include "data_cell_buffer.h"
#include "fluid_buffer.h"

constexpr DataCell weight{
	1./36., 1./9., 1./36.,
	1./9.,  4./9., 1./9.,
	1./36., 1./9., 1./36
};

struct Cell : DataCell {
	void equilibrize(Density d, Velocity v);

	double sum() const;

	Velocity velocity(Density d) const;
};

void streamFluidCell(DataCellBuffer& pop, std::size_t x, std::size_t y);

void collideFluidCell(
	double omega,
	DataCellBuffer& pop, FluidBuffer& fluid,
	std::size_t x, std::size_t y);