Hi,
I am trying to simulate flow in porous media using palabos and I intend to impose periodic boundaries with bounceback condition on obstacles. However, I get the following error message and I think its from my definition of bounceback, which I think was done correctly. I would appreciate if my mistake is pointed out to me
Error message
womersley.cpp: In function ‘void porousmediadomain(plb::MultiBlockLattice3D<T, plb::descriptors::ForcedD3Q19Descriptor>&, const plb::IncomprFlowParam&, plb::MultiScalarField3D&)’:
womersley.cpp:127: error: no matching function for call to ‘defineDynamics(plb::MultiBlockLattice3D<T, plb::descriptors::ForcedD3Q19Descriptor>&, plb::MultiScalarField3D&, plb::BounceBack<T, plb::descriptors::ForcedD3Q19Descriptor>*, bool)’
scons: *** [womersley.o] Error 1
scons: building terminated because of errors.
make: *** [compile] Error 2
The code is shown below.
#include “palabos3D.h”
#ifndef PLB_PRECOMPILED // Unless precompiled version is used,
#include “palabos3D.hh” // include full template code
#endif
#include
#include
#include
#include
using namespace plb;
using namespace std;
typedef double T;
#define DESCRIPTOR descriptors::ForcedD3Q19Descriptor
T poiseuilleforce = 1e-4;
void porousmediadomain( MultiBlockLattice3D<T,DESCRIPTOR>& lattice,
IncomprFlowParam const& parameters,
MultiScalarField3D& mediadomain)
{
const plint nx = lattice.getNx();
const plint ny = lattice.getNy();
const plint nz = lattice.getNz();
pcout << "Definition of the geometry." << endl;
// Where "geometry" evaluates to 1, use bounce-back.
defineDynamics(lattice, mediadomain, new BounceBack<T,DESCRIPTOR>(), true); //this is line 127
pcout << "Initilization of rho and u." << endl;
Array<T,3>u(0.,0.,0.);
initializeAtEquilibrium( lattice, lattice.getBoundingBox(), 1.0, u);
Array<T,3>force(poiseuilleforce, T(), T() );
//Array<T,3> & force(1e-3, T(),T());
// setExternalVector(lattice,lattice.getBoundingBox(),
// DESCRIPTOR<T>::ExternalField::forceBeginsAt,DESCRIPTOR<T>::ExternalField::sizeOfForce, force);
setExternalVector(lattice,lattice.getBoundingBox(),DESCRIPTOR<T>::ExternalField::forceBeginsAt, force);
lattice.initialize();
}
int main(int argc, char* argv[]) {
plbInit(&argc, &argv);
global::directories().setOutputDir("./tmp/");
IncomprFlowParam<T> parameters(
(T) 1e-2, // uMax
(T) 7.5, // Re
num, // N
1., // lx
1., // ly
1. // lz
);
const T logT = (T)1/(T)100;
const T imSave = (T)1/(T)10;
const T vtkSave = (T)1/10;
const T maxT = (T)15.;
writeLogFile(parameters, "Porous media");
const plint nx = parameters.getNx();
const plint ny = parameters.getNy();
const plint nz = parameters.getNz();
const T omega = parameters.getOmega();
pcout << "Creation of the lattice." << endl;
MultiBlockLattice3D<T, DESCRIPTOR> lattice (nx, ny, nz, new HeExternalForceBGKdynamics<T, DESCRIPTOR>( omega) );
// Switch off periodicity.
lattice.periodicity().toggleAll(true);
pcout << "Reading the geometry file." << endl;
MultiScalarField3D<T> mediadomain(nx, ny, nz);
plb_ifstream fileinput("fccsphs100.txt");
if(!fileinput.is_open()) {
pcout << "Error: could not open geometry file " << endl;
return -1;
}
fileinput >> mediadomain;
porousmediadomain(lattice, parameters, mediadomain);
// define convergence
pcout << "Simulation begins" << endl;
plint iT=0;