Physical and Lattice units
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Physical and Lattice units
- This topic has 2 replies, 2 voices, and was last updated 8 years, 3 months ago by aliiab.
-
AuthorPosts
-
August 29, 2016 at 12:30 pm #1855aliiabMember
Hello!rnrnI’ve got a number of questions correspond to the conversion between physical and lattice measure units.rnrnrn1. I want to put density data to the VTK file. For pressure I can use a functor SuperLatticePhysPressureXD, for velocity I can use a functor SuperLatticePhysVelocityXD to get data in physical units. But for density I found only one functor – SuperLatticeDensityXD – for density in lattice units. Why there is not any analog of SuperLatticePhysVelocityXD for density (SuperLatticePhysDensityXD)? How can I convert data from SuperLatticeDensityXD to physical units?rnrn2. One has to use functions SuperLatticeXD::defineU, SuperLatticeXD::defineRhoU, SuperLatticeXD::iniEquilibrium to set initial and boundary conditions.rnrnSimple code for initial conditions:rn
Code:/// Initial conditionsrn AnalyticalConst3D<T,T> rhoF( 1 );rn std::vector<T> velocity( 3,T() );rn velocity[0] = 1.0*converter.getLatticeU();rn AnalyticalConst3D<T,T> uF( velocity );rnrn // Initialize all values of distribution functions to their local equilibriumrn sLattice.defineRhoU( superGeometry, 1, rhoF, uF );rn sLattice.iniEquilibrium( superGeometry, 1, rhoF, uF );rn sLattice.defineRhoU( superGeometry, 3, rhoF, uF );rn sLattice.iniEquilibrium( superGeometry, 3, rhoF, uF );rn sLattice.defineRhoU( superGeometry, 4, rhoF, uF );rn sLattice.iniEquilibrium( superGeometry, 4, rhoF, uF );rnrnConverter:rnrn
Code:LBconverter<T> converter(rn ( int ) 3, // dimrn ( T ) L, // latticeL_rn ( T ) 0.02/M, // latticeU_rn ( T ) 0.2*2.*0.05/Re, // charNu_rn ( T ) 0.1, // charL_ = 1rn ( T ) 0.01, // charU_ = 1rn ( T ) 1000.0 // charRho_rn );rnrnTo set initial velocity I used converter.getLatticeU(), but for density I don’t get any data from converter. Is it right? In my opinion, these initial conditions fill the channel by liquid flow with density = 1000kg/m^3 and velocity = 0.01 m/s and I have to set boundary conditions in lattice units.rnrnThanks,rnAlina.rnrn
August 30, 2016 at 8:32 am #2435robin.trunkKeymasterHi Alina,rnrn1)rnIn LBM the density differs from the pressure only by constants, you can find the relation in the LBconverter. Creating an output of physical density can be done by applying some arithmetic:rnphysDensity = charRho * latticeDensityrnYou can create your own output with AnalyticalXD objects and SuperLatticeFfromAnalyticalFXD. In your case it looks like this:rn
Code:AnalyticalConst3D<T,T> rhoAnalytical(converter.getCharRho());rn SuperLatticeFfromAnalyticalF3D<T,DESCRIPTOR> rhoLatticeF(rhoAnalytical, sLattice);rn SuperLatticeDensity3D<T, ADDESCRIPTOR> latticeDensity(sLattice);rn vtkWriter.addFunctor(rhoLatticeF*latticeDensity);rnrn2)rn
Quote:In my opinion, these initial conditions fill the channel by liquid flow with density = 1000kg/m^3 and velocity = 0.01 m/s and I have to set boundary conditions in lattice units.rnThats all correct. Usually the values rho=1 and u=(0,0,0) are used, this represents a domain filled with a fluid at rest.rnrnBestrnRobinrn
August 30, 2016 at 8:59 am #2436aliiabMemberRobin, thank you for detailed explanation.
-
AuthorPosts
- You must be logged in to reply to this topic.