Skip to content

Reply To: External force on specific cells

#8935
FBukreev
Keymaster

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(force);
}
};

then in main class:
sLattice.addPostProcessor(meta::id{});

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