Reply To: External force on specific cells
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › External force on specific cells › Reply To: External force on specific cells
Hello Luka,
you can try to use gpu appropriate postprocessor:
struct PostProcessor {
static constexpr OperatorScope scope = OperatorScope::PerCellWithParameters;
using parameters = meta::list
int getPriority() const {
return 0;
}
template
void apply(CELL& cell, PARAMETERS& params) any_platform {
using V = typename CELL::value_t;
std::size_t iT = params.template get
….
V force = …;
cell.template setField
}
};
then in main class:
sLattice.addPostProcessor
and in the simulation for loop:
sLattice.executePostProcessors(stage::PreCoupling());
Please do not forget to convert force from SI units to lattice units, whereby in lattice units in openlb force must be also divided by density.
Best wishes
Fedor