Skip to content

Reply To: Unit conversion


Hello everyone

I have read 《The Lattice Boltzmann method》by Krüger et al, and have a thorough understanding of the principle of unit conversion, but I don’t understand the application of unit conversion in the program. For example, there are two things I don’t understand in the following code:

void prepareGeometry( UnitConverter<T, DESCRIPTOR> const& converter,
SuperGeometry2D<T>& superGeometry )
Vector<T,2> extend( lengthX,lengthY );
Vector<T,2> center( centerCylinderX,centerCylinderY );
Vector<T,2> origin;
IndicatorCircle2D<T> circle( center, radiusCylinder );

superGeometry.rename( 0,2 );
superGeometry.rename( 2,1,1,1 );

extend[0] = 2.*L;
origin[0] = -L;
IndicatorCuboid2D<T> inflow( extend, origin );
superGeometry.rename( 2,3,1,inflow );
origin[0] = lengthX-L;
IndicatorCuboid2D<T> outflow( extend, origin );
superGeometry.rename( 2,4,1,outflow );
superGeometry.rename( 1,5,circle );
1. Why there is unit conversion in function parameters but not in function body;

2. When constructing geometry, SI units are used instead of lattice units. Under what circumstances should lattice units be used?

I hope you can help me solve this problem. I would appreciate it.