About ConvectionBC
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › About ConvectionBC
- This topic has 12 replies, 2 voices, and was last updated 7 years, 4 months ago by mathias.
-
AuthorPosts
-
June 26, 2017 at 12:55 pm #1919steed188Participant
Hi,
Although there were some discussion on the forum about ConvectionBoundary, I still have some problems with it.
Can I consider that this kind of bc as a free outflow where the gradient of pressure and other quantities is 0?Meanwhile, I imitate the examples as this
bc.addConvectionBoundary(superGeometry, 4, omega);
lattice.iniEquilibrium(superGeometry, 4, rhoF, uF);
lattice.defineRhoU(superGeometry, 4, rhoF, uF);The result seems that the flow didn’t go out from this bc. It just like a normal bounce back. While the flow went out regularly if I use PressureBoundary.
steed188
June 26, 2017 at 3:05 pm #2648mathiasKeymasterDear steed188,
yes, free outflow, i.e. gradient rho=0 and gredient velocity=0. PressureBC in OpenLB means rho=const and gradient velocity = 0.
Please check if the material numbers are assigned correctly. Actually bc.addConvectionBoundary(superGeometry, 4, omega); should work!
BEst
MathiasJuly 11, 2017 at 5:19 pm #2652steed188ParticipantDear mathias,
Sorry for so late.
Here’s a picture that I tried the convection and pressure boundary.[img]http://photry-production-virginia.s3.amazonaws.com/1288/1538/63365/large.jpeg?AWSAccessKeyId=AKIAIFWXMUQTJZO2WGXA&Expires=1499790408&Signature=4MGbkW0NFciumBPq2%2B8lyS5QQ90%3D[/img]
[img]http://photry-production-virginia.s3.amazonaws.com/1288/1538/63366/large.jpeg?AWSAccessKeyId=AKIAIFWXMUQTJZO2WGXA&Expires=1499790409&Signature=SASQFxbQCNSruGTwEErgo9usEJA%3D[/img]
You see that when I used pressure boundary, there was velocity there that the fluid went out.
While I used convection boundary, there is no velocity to go out . So that the fluid always moved in the filed and no outlet.That’s weird because I thought that the convection boundary should have same effect with pressure boundary in my case.
By the way, I’m working on some High Reynolds fluid that the kinetic viscosity gets 10e5. Under this kind of kinetic viscosity, the simulation is always diverged if using pressure bc. But the convection bc seems dose not work as I showed upper. Do you have some idea that how can I work with pressure bc under so high reynolds fluid?
best
steed188July 11, 2017 at 5:35 pm #2654mathiasKeymasterFor the convection bc, how did you set the to be imposed velocity?
July 11, 2017 at 5:45 pm #2656steed188ParticipantI just use defineRhoU to define the velocity(0,0,0) and Rho (1) on convection bc. Is it right?
July 11, 2017 at 9:17 pm #2658mathiasKeymasterNo, that is not the way. You need to use the define the right value “uAv” by prividing a pointer in the constructor:
virtual void olb::OnLatticeBoundaryCondition2D< T, Lattice >::addConvectionBoundary ( BlockGeometryStructure2D< T > & blockGeometryStructure,
int material,
T omega,
T * uAv = NULL
)Best
MathiasJuly 12, 2017 at 2:41 am #2659steed188ParticipantI’ve no idea what the uAv value means. There seems no comments about uAv in the source Code.
How should I get uAv value? Do I just create an new empty pointer?Best
steed188July 12, 2017 at 9:50 am #2660mathiasKeymasterThe value *uAv should be the actual value of the average velocity at the outflow area. That means you must set it to a desiged value or compute it with the e.g. flux functor every time step.
July 16, 2017 at 7:29 am #2662steed188ParticipantI tried the *uAv, but there seemed no difference ?
I First defined a global pointer uAv and initialize it.
Code:T aveOut =0;
T * uAv = &aveOut;Then defined the convection bc before iteration.
Code:void prepareLattice(….){
bc.addConvectionBoundary(superGeometry, 4, omega, uAv);
sLattice.defineRhoU(superGeometry, 4,rhoF, uF); //rhoF=1, uF=(0,0,0)
}Lastly calculated average velocity every time step and point it to the pointer
void getResults(){Code:IndicatorCircle3D<T> outflow( outCenter, outNormal, outRadius);
std::list<int> materials = { 1, 4};
SuperLatticePhysVelocityFlux3D<T,DESCRIPTOR>vFluxOutflow( sLattice,converter,superGeometry,outflow,materials );
int input[5] = {0};
T flux[5] = {0.};
vFluxOutflow( flux,input );T meanSpeed= flux[0]/flux[1];
uAv=&meanSpeed;}
I thought I did imposed the average velocity of the bc on *uAv.
I also tried to set a fix value to the *uAv. There was nothing different.
with best,
steed188July 16, 2017 at 11:50 am #2663mathiasKeymasterIt all seems correct. Did you check the material numbers for the outflow area?
July 16, 2017 at 3:10 pm #2664steed188ParticipantThe outflow is defined as below. The outflow bc is on the wall of point(0, 0, 0) to point(0, 2.5, 3.8). The positive x direction is to the inner of fluid.
Code:Vector<T, 3>outCenter(0, 1.8, 1.8) ;
T outRadius = 0.15;
Vector<T, 3> outNormal( T(1), T(), T() );
IndicatorCircle3D<T> outlet( outCenter, outNormal, outRadius);
IndicatorCylinder3D<T> outflow( outlet, 2 * converter.getLatticeL() );
superGeometry.rename( 2,4,1,outflow );The outflow bc seems to be set correctly because if I use pressure boundary it works well in low Re flow.
Then I use the same IndicatorCircle3D to set the outflow bc with material number 4 for flux as below.
Code:Vector<T, 3>outCenter(0,1.8,1.8) ;
T outRadius = 0.15;
Vector<T, 3> outNormal( T(1), T(), T() );
IndicatorCircle3D<T> outlet( outCenter, outNormal, outRadius);std::list<int> materials = { 1,3,4};
SuperLatticePhysVelocityFlux3D<T, DESCRIPTOR> vFluxOutflow0( sLattice, converter, superGeometry, outlet, materials );The mean velocity is a minus number. It means the flux is minus? And the convection bc didn’t work.
I didn’t know where is wrong.with best
steed188July 23, 2017 at 4:51 pm #2675steed188ParticipantBy thousands of check, I found why my convection BC didn’t work finally!!! 😀
I chose Local Boundary condition so that the bc didn’t work. If I chose Interp bc it worked!
May I asked the meaning of this two kinds of bc?By the way, as you said that I should use flux functor to calculate uAv every time step, I found that all of the flux functors are based on a circle shape, though my outlet is a rectangle. Is there a functor that can be used for rectangle shape?
My temporary solution is that defining a circle in the rectangle and using flux functor to calculate the uAv. Although it can be calculated but I’ve no idea whether it is correct.
July 24, 2017 at 7:55 am #2677mathiasKeymasterThese are different Types. Come to the spring school next year and we will have time to explain it in detail. The FluxFunctor should also work for materal numbers or with a greater cylinder including your rextangle plus a material number. Best Mathias
-
AuthorPosts
- You must be logged in to reply to this topic.