Skip to content

Pressure in openLB

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #7633
    Yuji
    Participant

    Dear Team openLB,

    I noticed that some examples cpp set dirichlet pressure condition(p=0), for example /examples/turbulence/nozzle3d.cpp
    Is this pressure boundary condition a gauge pressure? This is because nozzle3d.cpp has commentout; Dirichlet pressure condition is set by p=0 (i.e. rho=1).

    Moreover, I have 2 questions.
    1) I would like to set the specific pressure value. I am not sure how to define. And the instraction of “lattice.setProcessingContext<Array<momenta::FixedVelocityMomentumGeneric::VELOCITY>>(ProcessingContext::Simulation);” at the setBoundaryValues function has to be modified?
    2) I would like to set the neumann pressure condition. Are there any functions to set it?

    #7642
    stephan
    Moderator

    Dear Yuji,

    thank you for your post.
    Please note that, by construction, the physical pressure is assumed to be absolute.

    Wrt your questions:

    (1) To set a specific pressure value at the boundary, input the desired physical value (e.g. named pF) to the functor which sets the boundary values. So, irrespective of your actual boundary condition (e.g. setLocalPressureBoundary, setInterpolatedPressureBoundary), you can use the following:
    AnalyticalConst3D<T,T> rho(converter.getLatticeDensityFromPhysPressure(pF)); // to convert physical pressure to lattice density
    sLattice.defineRho(superGeometry, 4, rhoF); // to set the actual value, assuming that your outflow boundary has e.g. material number 4.

    2) Unfortunately, we do not have this kind of boundary included in OpenLB out of the box.

    Best,
    Stephan

    #7645
    Yuji
    Participant

    Dear Stephan,

    Thank your reply.
    As to the physical pressure, I understood it but is “the physical pressure” dynamic pressure?

    Additionaly, I would like to know the equation in setSlipBoundary. Could you teach me?

    Best

    #7646
    Yuji
    Participant

    When I use setSlipBoundary, I got an error;
    terminate called after throwing an instance of ‘std::runtime_error’
    what(): Legacy post processors not supported on GPU_CUDA
    Aborted

    How should I do to resolve it?

    I set this setSlipBoundary into marerial number 6 and 7 in “void prepareLattice” function. This instraction written by me is bellow. When I do the comment out at setSlipBoundary, the error does not appear.

    void prepareLattice( SuperLattice<T,DESCRIPTOR>& sLattice,
    UnitConverter<T,DESCRIPTOR> const& converter,
    STLreader<T>& stlReader,
    SuperGeometry<T,3>& superGeometry )
    {
    OstreamManager clout( std::cout,”prepareLattice” );
    clout << “Prepare Lattice …” << std::endl;

    const T omega = converter.getLatticeRelaxationFrequency();
    clout << “omega” << omega << ” ” << std::endl;

    // Material=1 –>bulk dynamics
    auto bulkIndicator = superGeometry.getMaterialIndicator({1});
    sLattice.defineDynamics<BGKdynamics>(bulkIndicator);

    // Material=2 –>bounce back
    setBounceBackBoundary(sLattice, superGeometry, 2);

    // Setting of the boundary conditions

    //if local boundary conditions are chosen
    //setLocalVelocityBoundary(sLattice, omega, superGeometry, 3);
    //setLocalPressureBoundary(sLattice, omega, superGeometry, 4);

    //if interpolated boundary conditions are chosen
    setInterpolatedVelocityBoundary(sLattice, omega, superGeometry, 3);
    setInterpolatedPressureBoundary(sLattice, omega, superGeometry, 4);

    // Material=5 –>bouzidi / bounce back
    #ifdef BOUZIDI
    setBouzidiBoundary<T,DESCRIPTOR>(sLattice, superGeometry, 5, stlReader);
    #else
    setBounceBackBoundary(sLattice, superGeometry, 5);
    #endif
    // Material = 6, 7
    setSlipBoundary<T,DESCRIPTOR>(sLattice, superGeometry, 6);
    setSlipBoundary<T,DESCRIPTOR>(sLattice, superGeometry, 7);

    // Initial conditions
    AnalyticalConst3D<T,T> rhoF( 1 );
    Vector<T,3> velocityV;
    velocityV[0] = converter.getCharLatticeVelocity();
    clout<< “velocityV=” << velocityV[0] << ” ” << velocityV[1] << ” ” << velocityV[2] << ” ” <<std::endl;
    AnalyticalConst3D<T,T> uF(velocityV);

    // Initialize all values of distribution functions to their local equilibrium
    sLattice.defineRhoU( bulkIndicator, rhoF, uF );
    // sLattice.defineRhoU( superGeometry, 6, rhoF, uF );
    sLattice.iniEquilibrium( bulkIndicator, rhoF, uF );

    sLattice.setParameter<descriptors::OMEGA>(omega);

    // Make the lattice ready for simulation
    sLattice.initialize();

    clout << “Prepare Lattice … OK” << std::endl;
    }

    Best

    #7647
    Yuji
    Participant

    The gpu_only_mixed.mk of config.mk is used in these cases.

    #7676
    Yuji
    Participant

    Sorry again.
    I want to use “setSlipBoundary” on GPU but got an error which is
    “terminate called after throwing an instance of ‘std::runtime_error’
    what(): Legacy post processors not supported on GPU_CUDA
    Aborted”

    Could you teach me how to use “setSlipBoundary” on GPU?

    #7677
    mathias
    Keymaster

    Dear Yuji,

    that still needs to be done and it is on our roadmap. How long it takes depends on future projects which we are hoping to get..

    Best
    Mathias

    #7678
    stephan
    Moderator

    Dear Yuji,

    regarding your second question, concerning the pressure, I can recommend you to read Section “7.2.1.2 Pressure, Stress and Force” in the book of Krüger et al. (https://doi.org/10.1007/978-3-319-44649-3).

    BR
    Stephan

    #7682
    Yuji
    Participant

    Dear all,

    Thank you. Understood. I wiil read it.

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