How to Change Fluid Properties
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › How to Change Fluid Properties
- This topic has 7 replies, 2 voices, and was last updated 8 years, 2 months ago by ivan.
-
AuthorPosts
-
June 16, 2016 at 3:08 pm #1837ivanMember
Hello, everybody,rnrnI am working with the example “”Cylinder2d”” and I would like to change the properties of the fluid for the same ones as (liquid) water. rnrnAs far as I understood, the Density is set in line 156, as shown:rnrn
Code:AnalyticalConst2D<T,T> rhoF(1);rnrnThen, I would just have to edit it to rnrn
Code:AnalyticalConst2D<T,T> rhoF(1000);rnrnConcerning the Viscosity, it seems like it is given in function of the cylinder diameter, reynolds number and velocity, in line 303, as shown:rnrn
Code:(T) 0.2*2.*radiusCylinder/Re, // charNu_rnrnIn this case, I would have to change these parameters in oder to reach the viscosity I want.rnrnNow let’s go to the questions:rnrn1. Why do I get very messed up images when I simply change rhoF from 1 to 1000?rn2. How can I change the velocity uF in order to set the viscosity as 0,001?rn3. Is the archive “”Cylinder.dat”” supposed to edit itself once I change the cpp file?rnrnBest regards,rnrnIvan
June 16, 2016 at 4:27 pm #2382Alejandro_ClaroMemberHi Ivan,rnrnWhat do you mean by “”messed up images””?rnrnYou should remember that the characteristical density of the model is 1 kg/m³ from the default parameter of the class LBconverter<T>. I know that the documentation says that the unit of this parameter is kg/m^d, but at the end it is 1 kg/m³.rnrnThe characteristical shear viscosity could be defined by the user in the class LBconverter<T>. So you can set up this variable.rnrnThe velocity “”uF”” is a initial condition for the problem. Thus it will not change the shear viscosity.rnrnI suppose that the file “”Cylinder.dat”” should be modified if you modify the parameter of the class LBconverter<T>. Otherwise, I do not see how it could be modified.rnrnBest Regards,rnrnAlejandro
June 16, 2016 at 4:50 pm #2384ivanMemberHello, Alejandro,rnrnFirst of all, thank you for the fast reply.rnrnBasically, what I meant with “”messed up images”” is this:rnrn
rnrnWhich is what happens when I simply switch rho(1) to rho(1000), as previously explained.rnrnAnd, as Im still a beginner, can you make it a little clearer? How do I set the class LBconverter<T>? I mean, the line 303 I mentioned is right here:rnrn
Code:LBconverter<T> converter(rn (int) 2, // dimrn (T) L, // latticeL_rn (T) 0.02/M, // latticeU_rn (T) 0.2*2.*radiusCylinder/Re, // charNu_rn (T) 2*radiusCylinder, // charL_ = 1rn (T) 0.2 // charU_ = 1rn );rn converter.print();rnrnIs that what you’re talking about? If so, the doubts remain.rnrnAtt.rnrn
June 16, 2016 at 5:45 pm #2385Alejandro_ClaroMemberHi Ivan,rnrnIf you see the class LBconverter<T>, the constructor could be seen here: http://optilb.com/DoxyGen/html/d1/d25/classolb_1_1LBconverter.html rnI will suppose you will use the cylinder2d example. The Reynolds number is a constant that you will impose to the model. The characteristical kinematic viscosity (CharNu) depends of the fluid, if it is water at 20°C then its value is 0.000001 m²/s. The characteristical length (CharL) of the problem is the diameter (2*radiusCylinder). The density of the water (CharRho) at the same temperature could be approximated by 1 kg/m³. rnrnThus, the charactersitical velocity (CharU) could be defined as: Re*CharNu/CharL = CharU.rnrnThe latticeL and LatticeU are the discretization parameter of the model that you use (I suppose you know theirs meaning).rnrnThe converter objet will be:rn
Code:LBconverter<T> converter(rn (int) 2, // dimrn (T) L, // latticeL_rn (T) 0.02/M, // latticeU_rn (T) 0.000001, // charNu_rn (T) 2*radiusCylinder, // charL_ = 1rn (T) Re*0.000001/(2*radiusCylinder), // charU_ = 1rn (T) 1000. // charRho : characteristical density of the waterrn );rnrnrnHope this post is more clear.rnrnBest,rnrnAlejandro
June 17, 2016 at 8:27 am #2386ivanMemberHello, Alejandro,rnrnThank you one more time for the reply.rnrnJust let me ask you, did you mean the density of the water (CharRho) to be 1000kg/m³? We’re talking about liquid, right? I this case, would the converter object be this one?rnrn
Code:LBconverter<T> converter(rn (int) 2, // dimrn (T) L, // latticeL_rn (T) 0.02/M, // latticeU_rn (T) 0.000001, // charNu_rn (T) 2*radiusCylinder, // charL_ = 1rn (T) Re*0.000001/(2*radiusCylinder), // charU_ = 1rn (T) 1000. // charRho : characteristical density of the waterrn );rnrnrnIf so, how does the cpp recognize the “”(T) 1000.”” line as related to the density? Still, would I have to do the same alterations in the line 156 as explained in the very first post?rnrnBest,rnrnIvan
June 17, 2016 at 8:45 am #2387Alejandro_ClaroMemberHi Ivan,rnrnYou are right, the density of the water that I posted was not correct (I modified my post). rnrnYou should see the link I send you where it is presented the function/method definition for the class LBconverter<T>. The next term of “”CharU”” has been defined as CharRho.rnrnYes, you should change the lien of code 156 in order to define the density of the water as the initial condition.rnrnBest,rnrnAlejandro
June 17, 2016 at 9:11 am #2388ivanMemberHello, Alejandro,rnrnSo, basically I’ve changed line 156 fromrnrn
Code:AnalyticalConst2D<T,T> rhoF(1);to
Code:AnalyticalConst2D<T,T> rhoF(1000);rnrnAnd the converter object fromrnrn
Code:LBconverter<T> converter(rn (int) 2, // dimrn (T) L, // latticeL_rn (T) 0.02/M, // latticeU_rn (T) 0.2*2.*radiusCylinder/Re, // charNu_rn (T) 2*radiusCylinder, // charL_ = 1rn (T) 0.2 // charU_ = 1rn );rn converter.print();rnrntornrn
Code:LBconverter<T> converter(rn (int) 2, // dimrn (T) L, // latticeL_rn (T) 0.02/M, // latticeU_rn (T) 0.000001, // charNu_rn (T) 2*radiusCylinder, // charL_ = 1rn (T) Re*0.000001/(2*radiusCylinder), // charU_ = 1rn (T) 1000. // charRhorn );rn converter.print();rnrnAnd the images are not being generated.rnrnAtt.rnrn
June 17, 2016 at 9:17 am #2389ivanMemberedited
-
AuthorPosts
- You must be logged in to reply to this topic.