本文整理汇总了C++中IncomprFlowParam::getLatticeU方法的典型用法代码示例。如果您正苦于以下问题:C++ IncomprFlowParam::getLatticeU方法的具体用法?C++ IncomprFlowParam::getLatticeU怎么用?C++ IncomprFlowParam::getLatticeU使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IncomprFlowParam
的用法示例。
在下文中一共展示了IncomprFlowParam::getLatticeU方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cavitySetup
void cavitySetup( MultiBlockLattice3D<T,DESCRIPTOR>& lattice,
IncomprFlowParam<T> const& parameters,
OnLatticeBoundaryCondition3D<T,DESCRIPTOR>& boundaryCondition )
{
const plint nx = parameters.getNx();
const plint ny = parameters.getNy();
const plint nz = parameters.getNz();
Box3D topLid = Box3D(0, nx-1, ny-1, ny-1, 0, nz-1);
Box3D bottomLid = Box3D(0, nx-1, 0, 0, 0, nz-1);
Box3D everythingButTopLid = Box3D(0, nx-1, 0, ny-2, 0, nz-1);
/*
instantiateOuterNLDboundary(lattice, lattice.getBoundingBox());
setOuterNLDboundaryDynamics(lattice, lattice.getBackgroundDynamics().clone(),
lattice.getBoundingBox(), boundary::dirichlet);
setOuterNLDboundaryDynamics(lattice, lattice.getBackgroundDynamics().clone(), bottomLid, boundary::neumann);
defineDynamics(lattice, bottomLid, lattice.getBackgroundDynamics().clone());
*/
boundaryCondition.setVelocityConditionOnBlockBoundaries(lattice, lattice.getBoundingBox(), boundary::dirichlet);
T u = sqrt((T)2)/(T)2 * parameters.getLatticeU();
initializeAtEquilibrium(lattice, everythingButTopLid, (T) 1., Array<T,3>(0.,0.,0.) );
initializeAtEquilibrium(lattice, topLid, (T) 1., Array<T,3>(u,0.,u) );
setBoundaryVelocity(lattice, topLid, Array<T,3>(u,0.,u) );
lattice.initialize();
}
示例2: computeRMSerror
T computeRMSerror ( MultiBlockLattice2D<T,NSDESCRIPTOR>& lattice,
IncomprFlowParam<T> const& parameters,
T alpha, plint iT, bool createImage=false)
{
MultiTensorField2D<T,2> analyticalVelocity(lattice);
setToFunction( analyticalVelocity, analyticalVelocity.getBoundingBox(),
WomersleyVelocity<T>(parameters,alpha,(T)iT) );
MultiTensorField2D<T,2> numericalVelocity(lattice);
computeVelocity(lattice, numericalVelocity, lattice.getBoundingBox());
// Divide by lattice velocity to normalize the error
return 1./parameters.getLatticeU() *
// Compute RMS difference between analytical and numerical solution
std::sqrt( computeAverage( *computeNormSqr (
*subtract(analyticalVelocity, numericalVelocity)
) ) );
}
示例3: cavitySetup
void cavitySetup( MultiBlockLattice2D<T,DESCRIPTOR>& lattice,
IncomprFlowParam<T> const& parameters,
OnLatticeBoundaryCondition2D<T,DESCRIPTOR>& boundaryCondition )
{
const plint nx = parameters.getNx();
const plint ny = parameters.getNy();
boundaryCondition.setVelocityConditionOnBlockBoundaries(lattice);
setBoundaryVelocity(lattice, lattice.getBoundingBox(), Array<T,2>(0.,0.) );
initializeAtEquilibrium(lattice, lattice.getBoundingBox(), 1., Array<T,2>(0.,0.) );
T u = parameters.getLatticeU();
setBoundaryVelocity(lattice, Box2D(1, nx-2, ny-1, ny-1), Array<T,2>(u,0.) );
initializeAtEquilibrium(lattice, Box2D(1, nx-2, ny-1, ny-1), 1., Array<T,2>(u,0.) );
lattice.initialize();
}
示例4: cavitySetup
void cavitySetup( MultiBlockLattice3D<T,DESCRIPTOR>& lattice,
IncomprFlowParam<T> const& parameters,
OnLatticeBoundaryCondition3D<T,DESCRIPTOR>& boundaryCondition )
{
const plint nx = parameters.getNx();
const plint ny = parameters.getNy();
const plint nz = parameters.getNz();
Box3D topLid = Box3D(0, nx-1, ny-1, ny-1, 0, nz-1);
Box3D everythingButTopLid = Box3D(0, nx-1, 0, ny-2, 0, nz-1);
boundaryCondition.setVelocityConditionOnBlockBoundaries(lattice);
T u = std::sqrt((T)2)/(T)2 * parameters.getLatticeU();
initializeAtEquilibrium(lattice, everythingButTopLid, (T)1., Array<T,3>((T)0.,(T)0.,(T)0.) );
initializeAtEquilibrium(lattice, topLid, (T)1., Array<T,3>(u,(T)0.,u) );
setBoundaryVelocity(lattice, topLid, Array<T,3>(u,(T)0.,u) );
lattice.initialize();
}
示例5: poiseuillePressure
/// Linearly decreasing pressure profile
T poiseuillePressure(plint iX, IncomprFlowParam<T> const& parameters) {
T Lx = parameters.getNx()-1;
T Ly = parameters.getNy()-1;
return 8.*parameters.getLatticeNu()*parameters.getLatticeU() / (Ly*Ly) * (Lx/(T)2-(T)iX);
}
示例6: poiseuilleVelocity
/// Velocity on the parabolic Poiseuille profile
T poiseuilleVelocity(plint iY, IncomprFlowParam<T> const& parameters) {
T y = (T)iY / parameters.getResolution();
return 4.*parameters.getLatticeU() * (y-y*y);
}