void halfCircleSetup ( MultiBlockLattice2D<T,DESCRIPTOR>& lattice, plint N, plint radius, OnLatticeBoundaryCondition2D<T,DESCRIPTOR>& boundaryCondition ) { // The channel is pressure-driven, with a difference deltaRho // between inlet and outlet. T deltaRho = 1.e-2; T rhoIn = 1. + deltaRho/2.; T rhoOut = 1. - deltaRho/2.; Box2D inlet (0, N/2, N/2, N/2); Box2D outlet(N/2+1, N, N/2, N/2); boundaryCondition.addPressureBoundary1P(inlet, lattice); boundaryCondition.addPressureBoundary1P(outlet, lattice); // Specify the inlet and outlet density. setBoundaryDensity (lattice, inlet, rhoIn); setBoundaryDensity (lattice, outlet, rhoOut); // Create the initial condition. Array<T,2> zeroVelocity((T)0.,(T)0.); T constantDensity = (T)1; initializeAtEquilibrium ( lattice, lattice.getBoundingBox(), constantDensity, zeroVelocity ); defineDynamics(lattice, lattice.getBoundingBox(), new BounceBackNodes<T>(N, radius), new BounceBack<T,DESCRIPTOR>); lattice.initialize(); }
void channelSetup( MultiBlockLattice2D<T,NSDESCRIPTOR>& lattice, IncomprFlowParam<T> const& parameters, OnLatticeBoundaryCondition2D<T,NSDESCRIPTOR>& boundaryCondition, T alpha, T frequency, T amplitude) { const plint nx = parameters.getNx(); const plint ny = parameters.getNy(); Box2D bottom( 0,nx-1, 0, 0); Box2D top( 0,nx-1, ny-1, ny-1); boundaryCondition.addVelocityBoundary1N(bottom, lattice); boundaryCondition.addPressureBoundary1P(top, lattice); Array<T,2> u((T)0.,(T)0.); setBoundaryVelocity( lattice, lattice.getBoundingBox(), u ); initializeAtEquilibrium(lattice,lattice.getBoundingBox(),(T)1.0,u); Array<T,NSDESCRIPTOR<T>::d> force(womersleyForce((T)0, amplitude, frequency, parameters),0.); setExternalVector(lattice,lattice.getBoundingBox(),NSDESCRIPTOR<T>::ExternalField::forceBeginsAt,force); lattice.initialize(); }