Skip to content

Alejandro_Claro

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • in reply to: Create a new Geometry #2502

    Hi cloner0101,

    Could you please give us more information about the case you are trying to simulate ?

    The porous media is not my field of research but I think you could create the geometry with a CAD software if it is in 3D. You will need q STL file for the geometry, you could check “aorta3d” example. If the geometry is 2d and your are able to know which nodes corresponds to wall nodes maybe you could see the “cylinder2d” example.

    The basic parameters are defined in the object “converter” that is defined in the main. The boundary conditions are usually defined first at the preparation of geometry. Then, theirs values are defined in a user-function. The initial conditions also are defined in this user-function. You could see the “cylinder2d” example to understand how it works.

    Best,
    Alejandro

    in reply to: Advices to simulate turbulent channel flow #2397

    Hi Mathias,rnrnThank you for quick reply. rnrnAccording to the turbulence model, I should use the Shear-Smagorinky model with the “”normal”” parameter (Cs = 0.16-0.13) in order to take into account the presence of the wall, where the Smagorinsky parameter tends to decrease.rnrnThe body force term (gravity in this case) have been decomposed in its x/y directions according to the slope of the channel. The simulation diverges when I take in account both directions (in my case “”y””). So, I use just the horizontal component. Do you know which could be the problem? Do I not compute the gravity body force term right? Should I just take into account the horizontal direction of this force because I do not use a “”Volume-of-Fluid”” approach in order to simulate the water level variation ?rnrnPreviously, I used a smooth start curve (PolynomialStartScale<T,T>) in order to begin from a Re = 300 to Re = 3000. All along the simulation I used the shear-smagorinsky turbulence model. However, the simulation diverged. Is it necessary to begin the simulation at low Re without a turbulence model and then to switch to moderate Re with a turbulence model for low spatial resolution?rnrnBest Regards,rnrnAlejandrornrn

    in reply to: DynSmagorinskyBGKdynamics – Error #2393

    Hi Mathias,rnrnMy phrase have been modified because it was incorrect.

    Quote:
    It should be noted that the smagoConstIsAt attribut have been defined as const static int (before was const static int)

    rnrnThe Lattice<T>::ExternalField::smagoConstIsAt returns a const static int not a const static T. Thus, I changed the type of return of the private attribute smagoConstIsAt in the class DynSmagorinskyBGKdynamics.rnrnThe collide method of the class DynSmagorinskyBGKdynamics seem to obtain the Smagorinsky parameter with the *cell.getExternal(Lattice<T>::ExternalField::smagoConstIsAt). However, I do not see where this parameter it is changed by the collide method of the class. It is changed by other method of the class?rnrnBest regards,rnAlejandro

    in reply to: DynSmagorinskyBGKdynamics – Error #2390

    Hi Mathias,rnrnI redefine the DynSmagorinskyBGKdynamics as:rn

    Code:
    template<typename T, template<typename U> class Lattice>rnclass DynSmagorinskyBGKdynamicsNew : public BGKdynamics<T,Lattice> {rnpublic:rn /// Constructorrn DynSmagorinskyBGKdynamicsNew(T omega_, Momenta<T,Lattice>& momenta_, T dx_, T dt_);rn /// Collision steprn virtual void collide(Cell<T,Lattice>& cell, LatticeStatistics<T>& statistics_);rn /// Collide with fixed velocityrn virtual void staticCollide(Cell<T,Lattice>& cell, const T u[Lattice<T>::d],rn LatticeStatistics<T>& statistics_);rn /// Set local relaxation parameter of the dynamicsrn virtual void setOmega(T omega_);rn /// Get local smagorinsky relaxation parameter of the dynamicsrn virtual T getSmagorinskyOmega(Cell<T,Lattice>& cell_);rnrnprivate:rn /// Computes a constant prefactor in order to speed up the computationrn T computePreFactor(T omega_, T smagoConst_, T dx_, T dt_);rn /// Computes the local smagorinsky relaxation parameterrn T computeOmega(T omega0_, T preFactor_, T rho_, T pi_[util::TensorVal<Lattice<T> >::n],rn Cell<T,Lattice>& cell);rn /// effective collision time based upon Smagorisnky approachrn T tau_eff;rn T dx;rn T dt;rn const static int smagoConstIsAt = Lattice<T>::ExternalField::smagoConstIsAt;rn};

    rnrnIt should be noted that the smagoConstIsAt attribut have been defined as const static int (before was const static T).

    Quote:
    This phrase have been modified, it have been changed const static int by const static T

    rnrnThe code compile well.rnrnNow, I some kind of confused about the real implementation of this turbulence model. I know that in this model determines the Smagorinsky parameter (Csm) in each cell at each time step. I understood that

    Code:
    const static int smagoConstIsAt = Lattice<T>::ExternalField::smagoConstIsAt

    give the position vector for a external field of the lattice. However, I have not figured out in which moment this “”external field”” have been created.rnrnShould the user give an initial value of this parameter by using for example:rn

    Code:
    template<typename T, template<typename U> class Lattice>rnvoid SuperLattice2D<T,Lattice>::defineExternalField(SuperGeometry2D<T>& sGeometry,rn int material, int fieldBeginsAt, int sizeOfField, AnalyticalF2D<T,T>& field)

    rnAs for the “”Poiseuille-Forced-2D”” example?rnrnBest regards,rnAlejandro

    in reply to: How to Change Fluid Properties #2387

    Hi 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

    in reply to: How to Change Fluid Properties #2385

    Hi 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 );rn

    rnrnHope this post is more clear.rnrnBest,rnrnAlejandro

    in reply to: DynSmagorinskyBGKdynamics – Error #2383

    Hi Mathias,rnrnI checked the “”Makefile.inc”” and I changed to “”generic””.rnrn

    Code:
    #BUILDTYPE := precompiledrnBUILDTYPE := generic

    rnrnAlso, I tested with the Shear Smagorinsky and ADM turbulence models and both complied well (not errors).rnrnBest regards,rnrnAlejandro rn

    in reply to: How to Change Fluid Properties #2382

    Hi 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

    in reply to: Free slip boundary condition #2372

    Hi marcanyada,rnrnThe free slip boundary condition on a straight wall have been already implemented in the addslipboundary function. The approach implemented is the specular reflection.rnrnOtherwise, you can write a new class in order to implement this condition in the post-process step. You could check how it is implemented with the createInterpBoundaryCondition2D class.rnrnBest Regards,rnAlejandro

    in reply to: ComputeStress Function – Error ? #2352

    Hi Mathias,rnrnThank you for your response. When you said that “”rho”” is usually set to be 1 + h², this h is the grid spacing?rnrnI am in the process to implement a case of turbulent flow. Thus, as soon as I get some results I will share with you.rnrnBest Regards, rnAlejandro

    in reply to: ComputeStress Function – Error ? #2350

    Hi Mathias,rnrnThe ComputeStress seems to give the second-order moment of the non-equilibrium distribution fi(1). The second-order moment of the distribution function is Sigma(Ci_A*Ci_B*[fi – fi(0)]). Ci is the discrete velocity; fi and fi(0) are the actual and the the equilibrium distribution functions in the lattice, respectively.rnrnSupposing that BGK collision model is used with a rectangular method for the collision operator. Then, the kinematic shear viscosity is

    Code:
    nu = (tau – 0.5)*pow(Cs,2)

    Where Cs is the velocity of the sound in the lattice system and tau is the relaxation time. The pressure is defined by

    Code:
    P = pow(Cs,2)*rho

    The second-order moment of the equilibrium distribution fi(0) is rn

    Code:
    rnSecond_Order_Moment_fi0 = rho*u_A*u_B + P* KroneckerDelta(A,B);rnSecond_Order_Moment_fi0 = rho*u_A*u_B + (pow(Cs,2)*rho)* KroneckerDelta(A,B);rn

    rnrnSo, the pressure is already is taken by the second right-side term of the previous expression, or I am wrong ? Thus, I do not understand why the extra term -1.*pow(Cs,2) is added to the previous expression? rnrnIn the user guide is indicated that the Smagorinsky model is based in the paper Nathen et al. (2013) An extension of the Lattice Boltzmann Method for simulating turbulent flows around rotating geometries of arbitrary shape. Unfortunately, I do not have access rights to read this document. The pressure term in this paper is obtained differently from the previous “”explanation”” ?rnrnBest Regards,rnrnAlejandro

    in reply to: Free-Slip Boundary Condition – Implementation Doubts #2348

    Hi Robin,rnrnThanks for your response. From your last post I have some doubts:rn

      rn1. What do you mean by doing an analogue implementation ?rnrn2. The vector

    n should be the normal vector in order to implement the condition grad(U)*n = 0. Maybe I did not express myself correctly in my post for the “”von Neumann boundary condition””. So in this case it is me that is wrong ;).rnrn3. I have not well understood the “”overlap”” region. But from your response, will all the nodes/lattices at the boundary be implemented to the boundary condition defined by slip-boundary/velocity-boundary/etc.? rnrnrnI am trying to implement the free-slip boundary condition at the boundary from the default non-local boundary condition based in the work of Skordos (1993). I figured out how the addVelocityBoundary from the class olb::sOnLatticeBoundaryCondition2D implements:rnrnolb::StraightFdBoundaryProcessor2D< T, Lattice, direction, orientation > Class Template ReferencernrnThis class corresponds to the algorithm proposed by Skordos. This class is used as post-processor. The process is called from the class SuperLatticeXD in the collideAndStream() function.rnrnI would like to define a new class from StraightFdBoundaryProcessor2D class in order to redefine a new process function that will define grad(U)*n = 0. Also, I am trying to inheritance the class SuperLattice2D to add a new function addFreeSlipBoundary which will used to invoke the new class from StraightFdBoundaryProcessor2D. Basically, I want to modify the post-process function according to what I want and then I define a new function to implement this post-processor function, like the addVelocityBoundary function.rnrnDo you have any idea how could this could be made ? Does exist a better way to give the boundary conditions for the velocity and the grad(u) in the Skordos algorithm?rnrnBest Regards,rnrnAlejandro

    in reply to: Free-Slip Boundary Condition – Implementation Doubts #2346

    Hi Robin,rnrnThank you for your response. I have not been tried to implement the addConvectionBoundary function of the class sOnLatticeBoundaryCondition2D. I have already read your paper Inertial dilute particulate fluid flow simulations with an Euler–Euler lattice Boltzmann method, where you implemented this convection-boundary in order to simulate an outflow condition. It seems that “”advectionDiffusionBoundayPostProcessiorXD.h/hh”” it is only implemented in 3D, right? rnrnIn the case of free-slip, if “”U“”is the velocity vector and “”n“” is the normal vector to the boundary pointing outwards, the grad(U)*n = 0 (0 is the zero vector). Thus, if I am not wrong, the outflow condition of your paper should not be applied for this kind of boundary.rnrnI checked the addSlipBoundary function available in olb::sOnLatticeBoundaryCondition2D< T, Lattice > Class Template Reference. The processSubDomain, located in SlipBoundaryProcessor2D, works as the specular reflection approach explained by myself at the beginning of this post. However, I do not understand why the corner nodes are treated as a bounce-back for the diagonal direction and the vertical and horizontal are switched 90°. For example, for a D2Q9 lattice and the North-West node, the distributions changed are :rn

      f4 = f2rnf5 = f1rnf6 = f8

    rnrnIt should be noted that the lattice arrangement is:rn

    Code:
    rn 1—-8—-7rn|| || ||rn 2—-0—-6rn|| || ||rn 3—-4—-5rn

    rnrnAs pointed out by in Question about Cavity2d Example and How to set a slip boundary posts, it seems that the nodes residing in the overlap region could not be implemented as a Slip-Boundary-Condition. Does someone know how to “”fix”” or overcome this problem?rnrnFinally, the user guide indicates that createInterpBoundaryConditionXD is the default non-local boundary condition based in the work of Skordos (1993). It seems that “”StraightFdBoundaryProcessor2D“” and “”PlaneFdBoundaryProcessor3D“” correspond to the post-processing classes for 2D and 3D, respectively. Does someone know how theses classes are accessed by the createInterpBoundaryConditionXD object ? Because from the sOnLatticeBoundaryConditionXD class only the velocity/pressure/slip/convection boundary functions are available. rnrnBest regards,rnAlejandrorn

    in reply to: Force term – Units ? #2369

    Hi Robin,rnrnThank you for your response. However, I am still confuse about how it is implemented this body force.rnrnIf m** is the length in lattice units and t** is the time in lattice units. Then, according to the line of code for the poiseuille-forced-2d example:rn

    Code:
    T Ly = converter.numCells(ly);rn std::vector<T> poiseuilleForce(2,T());rn poiseuilleForce[0] = 8.*converter.getLatticeNu()*converter.getLatticeU() / (Ly*Ly);

    rnThe poiseuilleForce x-component vector has acceleration lattice units (m**/(s**)²). In the poiseuille-forced-2d example the characteristics density and length are both unity. Thus, the “”mass”” in lattice units [CharRho * DeltaX³] is equal to 1. This is the reason why it is not wrote the “”mass”” in lattice units?rnrnThe body force F = rho*g [kg/m³ * m/s²] defined in Ghou et al. (2002) has not the units of N [kg * m/s²]. Thus, LBconverter.latticeForce(value) should not be used because the force in the physical system (value) will be dimensionless by LBconverter.physForce() which has N physical units. It is that right? rnrnIn the case of a incompressible and isothermal problem, the body force term g in the Navier-Stokes equations have [m/s²] physical units. This body force term in the dimensionless Navier-Stokes equations is:rn

    Code:
    g_d = 1/Fr² // Fr is the Froude number

    rnTo pass from dimensionless to lattice units I use the same procedure presented in Latt (2008).rn

      g_d = dx/dt² * g_lbrng_lb = dt²/dx * g_drng_lb = dt²/dx * (1/Fr²)

    rnI would like to know if it is correct to insert this gravity acceleration in lattice units [g_lb] in the force vector ? rnrnPD: Ghou et al. (2002) Discrete lattice effects on the forcing term in the lattice Boltzmann method.rnLatt (2008) Choice of units in lattice Boltzmann simulations.rnrnBest regards,rnrnAlejandro

    in reply to: Free-Slip Boundary Condition – Implementation Doubts #2367

    Hi Robin,rnrnThank you for your response. I am trying to “”copy-paste”” the Bounce-Back template in the code to change just the “”collide”” function. From the specular reflection’s concept I am having some difficulties to create a code that it is independent of the location of the surface and the existence of corners/edges in 2D/3D. However, I will tested this approach in the 2dcylinder example.rnrnI read the user guide of OpenLB and I found that in section 2.2 (define and use boundary conditions) the createInterpBoundaryConditionXD allows to implement the non-local boundaries. The velocity gradient is evaluated with this “”option””. If I well understood, the non-local boundary implements a post-process step (just after the streaming step). I seems that the Class Template olb::BlockLattice3D<T,Lattice> has the function addPostProcessor (PostProcessorGenerator3D<T,Lattice> const &ppGen). The PostProcessorGenerator3D<T,Lattice> class has been implemented in Class Template olb::PlaneFdBoundaryProcessorGenerator3D<T,Lattice,direction,orientation>. However, I do not figure out how to define the post-process routine. In this routine I would like to implement the functions found in olb::fd Namespace.rnrnThe direction and orientation parameters in PlaneFdBoundaryProcessorGenerator3D are for the plane of interest ? Theses parameters are scalars or vector ? The normal vector of the surface is inwards or outwards of it ? rnrnI will check your paper in these days.rnrnBest regards,rnAlejandro

Viewing 15 posts - 1 through 15 (of 27 total)