本文整理汇总了C++中IncomprFlowParam::getDeltaX方法的典型用法代码示例。如果您正苦于以下问题:C++ IncomprFlowParam::getDeltaX方法的具体用法?C++ IncomprFlowParam::getDeltaX怎么用?C++ IncomprFlowParam::getDeltaX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IncomprFlowParam
的用法示例。
在下文中一共展示了IncomprFlowParam::getDeltaX方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[]) {
plbInit(&argc, &argv);
global::directories().setOutputDir("./tmp/");
IncomprFlowParam<T> parameters (
(T) 1e-2, // uMax
(T) 10., // Re
30, // N
2., // lx
1. // ly
);
plint nx = parameters.getNx();
plint ny = parameters.getNy();
writeLogFile(parameters, "Poiseuille flow");
MultiBlockLattice2D<T, DESCRIPTOR> lattice (
nx, ny,
new BGKdynamics<T,DESCRIPTOR>(parameters.getOmega()) );
OnLatticeBoundaryCondition2D<T,DESCRIPTOR>*
boundaryCondition = createLocalBoundaryCondition2D<T,DESCRIPTOR>();
createPoiseuilleBoundaries(lattice, parameters, *boundaryCondition);
lattice.initialize();
// The following command opens a text-file, in which the velocity-profile
// in the middle of the channel will be written and several successive
// time steps. Note the use of plb_ofstream instead of the standard C++
// ofstream, which is required to guarantee a consistent behavior in MPI-
// parallel programs.
plb_ofstream successiveProfiles("velocityProfiles.dat");
// Main loop over time steps.
for (plint iT=0; iT<10000; ++iT) {
if (iT%1000==0) {
pcout << "At iteration step " << iT
<< ", the density along the channel is " << endl;
pcout << setprecision(7)
<< *computeDensity(lattice, Box2D(0, nx-1, ny/2, ny/2))
<< endl << endl;
Box2D profileSection(nx/2, nx/2, 0, ny-1);
successiveProfiles
<< setprecision(4)
// (2) Convert from lattice to physical units.
<< *multiply (
parameters.getDeltaX() / parameters.getDeltaT(),
// (1) Compute velocity norm along the chosen section.
*computeVelocityNorm (lattice, profileSection) )
<< endl;
}
// Lattice Boltzmann iteration step.
lattice.collideAndStream();
}
delete boundaryCondition;
}
示例2: writeVTK
void writeVTK(MultiBlockLattice2D<T,DESCRIPTOR>& lattice,
IncomprFlowParam<T> const& parameters, plint iter)
{
T dx = parameters.getDeltaX();
T dt = parameters.getDeltaT();
VtkImageOutput2D<T> vtkOut(createFileName("vtk", iter, 6), dx);
vtkOut.writeData<float>(*computeVelocityNorm(lattice), "velocityNorm", dx/dt);
vtkOut.writeData<2,float>(*computeVelocity(lattice), "velocity", dx/dt);
}
示例3: writeVTK
void writeVTK(BlockLatticeT& lattice,
IncomprFlowParam<T> const& parameters, plint iter)
{
T dx = parameters.getDeltaX();
T dt = parameters.getDeltaT();
VtkImageOutput3D<T> vtkOut(createFileName("vtk", iter, 6), dx);
vtkOut.writeData<float>(*computeVelocityNorm(lattice), "velocityNorm", dx/dt);
vtkOut.writeData<3,float>(*computeVelocity(lattice), "velocity", dx/dt);
vtkOut.writeData<3,float>(*computeVorticity(*computeVelocity(lattice)), "vorticity", 1./dt);
}