Skip to content

Pressure Inlet

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #1885
    takamori67
    Member

    Hello everyone,
    I am trying to implement flow through a pipe and would like to use a pressure boundary condition at the inlet and the outlet. Since there were only velocity boundary conditions at the inlet in the examples, I am not sure how to implement the pressure BC.

    I tried adding pressure BC at the inlet and outlet:

    Quote:
    bc.addPressureBoundary(superGeometry, 3, omega);
    bc.addPressureBoundary(superGeometry, 4, omega);

    and then setting the bounday values:

    Quote:
    AnalyticalConst3D<T,T> rhoIn(10);
    AnalyticalConst3D<T,T> rhoOut(1);
    sLattice.defineRho(superGeometry, 3, rhoIn);
    sLattice.defineRho(superGeometry, 4, rhoOut);

    But that did not work, all values were set to NaN after the 1st time step.

    I am wondering how to set the inflow pressure value, since you can only set the density in lattice units. Is there a way to set a pressure at the inlet and outlet (i.e. a pressure differential) in physical pressure units?

    Thanks,
    Sumit

    #2503
    robin.trunk
    Keymaster

    Hi Sumit,

    the function defineRho() expects lattice values. To convert a physical pressure to a lattice value, there is a function in the LBconverter called rhoFromPhysicalPressure, just have a look at the doxygen documentation:
    http://optilb.com/DoxyGen/html/d1/d25/classolb_1_1LBconverter.html#aa6409429bced9f84d2035b196ace082c

    Also when looking at e.g. the cylinder2D example the inflow velocity is slowly increased in the function setBoundaryValues(), you could try that for the pressure too. Setting large gradients without smooth transition can lead to numerical instabilities.

    Best
    Robin

    #2504
    takamori67
    Member

    Hi Robin,
    thank you for the information! I will try it out.

    Best,
    Sumit

    #2505
    takamori67
    Member

    Hi Robin,
    I’m having issues with the set up of the boundary values.

    Quote:
    AnalyticalF3D<T,S>(1) rhoIn;
    rhoIn = converter.rhoFromPhysicalPressure(pIn);
    sLattice.defineRho( superGeometry, 3, rhoIn);

    defineRho expects the density in the AnalyticalF3D format. However, how do I define my inlet density rhoIn as a AnalyticalF3D correctly? The doxygen page for AnalyticalF3D is somewhat cryptic.

    Best, Sumit

    #2506
    robin.trunk
    Keymaster

    Hi Sumit,

    AnalyticalConst3D<T,T> rhoF(1) should initialize a functor rhoF with value 1. The AnalyticalF3D is rather a mother class and can not be directly initialized with a value.

    Best
    Robin

    #2508
    takamori67
    Member

    Hi Robin,
    thanks for the insight!
    When I initialize it with the rho converted from the pressure (with a transition factor) it succeeds to compile

    Quote:
    AnalyticalConst3D<T,T> rhoIn(frac[0]*converter.rhoFromPhysicalPressure(pIn));

    However, when I initialize it with a value, let’s say 1 and after that set it to the convertetd rho, it fails to compile.

    Quote:
    AnalyticalConst3D<T,T> rhoIn(1);
    rhoIn = frac[0]*converter.rhoFromPhysicalPressure(pIn);

    Is this because once initialized, the AnalyticalConstant3D is cannot be changed?

    Thanks for the great and quick help, Robin!

    Best,
    Sumit

    #2509
    robin.trunk
    Keymaster

    Hi Sumit,

    thats correct. Once initialized the value can not be changed. Usually the values of the boundary are updated in the setBoundaryValues() function of a case file (see e.g. Cylinder2D example where a Poiseuille2D functor is applied instead of a AnalyticalConst3D). So in every time step the object is constructed woth a different value.

    Best
    Robin

    #2511
    takamori67
    Member

    Alright, that makes sense. Thank you!

    #2894
    LaurentDelaon
    Participant

    Hi robin
    If you have two pressure boundary

    Code:
    bc.addPressureBoundary(superGeometry, 4, omegaP1);
    bc.addPressureBoundary(superGeometry, 4, omegaP2);

    how did you set the pressure inlet ? the code with inlet velocity and outlet pressure seem affecte the value pressure and velocity boundary base on the material of the cuboid wich define the output and the input…
    Here you have two differents boudary with the same material 4. How did you do to affecte the correct value to each boundary ?
    I try to modify cylinder2d to have delta P .

    Laurent.

    #2895
    robin.trunk
    Keymaster

    Hi Laurent,

    modifying cylinder2d you rather want:

    bc.addPressureBoundary(superGeometry, 3, omega);
    bc.addPressureBoundary(superGeometry, 4, omega);

    This sets one Pressure at the inlet (material number 3) replacing the velocity boundary and keeps the already existing pressure boundary at the outlet (material number 4). You want both boundaries to have the same omega, as different omega would imply either a different discretisation (what is not the case) or a difference in the physical viscosity (what you probably do not want to simulate).

    Now you want to set different pressures to the two pressure boundaries. This can be done in the setBoundaryValues function in cylinder2d. Just replace the “defineU” by a “defineRho” function with appropriate arguments.
    You can construct an object for the pressure by
    AnalyticalConst2D<T,T> rho(converter.getLatticeDensityFromPhysPressure( >>pressure in Pa<<);

    Best
    Robin

    #2896
    LaurentDelaon
    Participant

    hi thank’s for your reply.
    I have a doubt doc p43:

    Quote:
    (1=fluid,
    2=no-slip boundary, 3=velocity boundary, 4=constant pressure boundary,
    5=curved boundary, 0=do nothing)

    .
    Seem for me that material is typed :type 1 is fluid 3 velocity and 4 pression… define for each cuboid.
    so boundary with 3 is velocity … if i want a pressure i do put a 4 no????
    laurent.

    #2897
    robin.trunk
    Keymaster

    Hi Laurent,

    the material numbers do not specify the type of an area, but rather the area itself. This means it is
    3 = boundary layer on the left
    4 = boundary layer on the right
    The type of boundary is defined by “addPressureBoundary” or “addVelocityBoundary” respectively.

    To get a better grip on these topics you may want to visit our next Spring School in february:
    http://www.openlb.net/spring-school-2019

    Best
    Robin

    #2899
    LaurentDelaon
    Participant

    Alright i can put any material number that I wants ? Desicribed an area_i with the number_i.

    #2900
    mathias
    Keymaster

    Yes, you can! Best Mathias

    #2933
    LaurentDelaon
    Participant

    Hi Robin,
    I have progress in my case studies based on cylinder2d.
    I’m arrive to measure pressures;
    But I want to know how measure Static Pressure ? How obtain it in 2d ?
    Is the pressure given by GetPressure is the same that the total pressure ?

    Regards.
    Laurentotal

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.