Skip to content

Cnojugated Heat Transfer

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #7132
    Henderson_C
    Participant

    Hello OpenLB community,

    I apologize for the redundant questions as I am still not very familiar with the code.
    I was wondering how can I apply certain thermal dynamics on a solid obstacle in an enclosure filled with a fluid. In one of the forum questions I came across the dynamics (advectionDiffusionBulkDynamicsSolid). When I use it, it says it was not declared in the scope.

    Best regards,

    #7134
    Adrian
    Keymaster

    Can you link the forum question? Most likely advectionDiffusionBulkDynamicsSolid is only the name of the dynamics reference and not its type so I can not tell which exact dynamics you want. This is also why you get the “not declared in scope” error.

    For thermal transport one can use e.g. the AdvectionDiffusionBGKdynamics on the thermal lattice coupled to the Navier Stokes lattice used for modelling the fluid. If you want to model temperature transport both by the fluid and inside of the obstacle you want to couple both lattices together and chose different parameterizations for fluid and obstacle cells on the ADE lattice (on the NSE lattice solid cells need to be modelled using an appropriate boundary condition).

    See the example cases in examples/thermal/ to get started. E.g. examples/thermal/squareCavity2d for natural convection in a square cavity.

    #8019
    Inko0521@126.com
    Participant

    Hello OpenLB community,

    I think the forum question he mentioned is this:
    https://www.openlb.net/forum/topic/thermal-fluid-and-conjugate-heat-transfer/

    I’ve also recently been trying to simulate a conjugate heat transfer problem for solids and liquids using Openlb, and I need to set the thermophysical parameters for solids and liquids separately. In the version olb-1.3r0, everything works well when I use the following codes:
    In the case ‘RayleighBenard2d’, I defined two AD dynamics, one for the fluid, one for the solid. Meanwhile, there are different omegas from different converters, so there have to be two converters as well.
    Codes(here: 5 = fluid, 6 = solid):
    ADlattice.defineDynamics(superGeometry, 5, &advectionDiffusionBulkDynamics);
    ADlattice.defineDynamics(superGeometry, 6, &advectionDiffusionBulkDynamicsSolid);

    AdvectionDiffusionBGKdynamics<T, TDESCRIPTOR> TbulkDynamics (
    converter.getOmegaT(),
    instances::getAdvectionDiffusionBulkMomenta<T,TDESCRIPTOR>()
    );
    AdvectionDiffusionBGKdynamics<T, TDESCRIPTOR> TbulkDynamicsSolid (
    converterSolid.getOmegaT(),
    instances::getAdvectionDiffusionBulkMomenta<T,TDESCRIPTOR>()
    );

    But in newer versions(olb-1.5r0), the header files seem to have changed considerably, and these codes don’t work anymore. What is the new way to make this string of code functional and meet my needs (set the thermophysical parameters for solids and liquids separately) please.
    I;m looking forward to your reply!

    Best regards,
    Jethan

    #8021
    Adrian
    Keymaster

    Yes, the dynamics system was completely overhauled with release 1.5 to enable transparent support for GPUs and vectorizations on CPUs. Even when you do not use this, the CPU performance was significantly improved due to data structure changes in 1.4 and 1.5. You can read more in the release notes of 1.4-1.6 and the associated user guides.

    For your particular question: The way such local parameterizations are realized now is via fields. i.e. you can define a cell-specific relaxation frequency if you restate the AdvectionDiffusionBGKdynamics
    as

    
    template<typename T, typename DESCRIPTOR, typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
    using LocalOmegaAdvectionDiffusionBGK = dynamics::Tuple<
      T,DESCRIPTOR,
      MOMENTA,
      equilibria::FirstOrder,
      collision::OmegaFromCell<collision::BGK>, // instead of just collision BGK in AdvectionDiffusionBGKdynamics
      AdvectionDiffusionExternalVelocityCollision
    >;
    

    To aid the understanding, the OmegaFromCell collision modifier is defined as:

    
    /// Override COLLISION parameter OMEGA with cell field OMEGA
    template <typename COLLISION>
    using OmegaFromCell = ParameterFromCell<descriptors::OMEGA, COLLISION>;
    

    i.e. you can apply the same pattern to enable cell-specific definition of any dynamics parameter.

    In the present case you set the per-cell omega using a call to

    
    sLattice.defineField<descriptors::OMEGA>(...);
    

    using OpenLB’s established indicator and functor concept.

    In general the dynamics tuple system introduced in 1.5 allows the flexible construction of local cell models by (re)combining moments, equilibria and collision operators.

    #8040
    Inko0521@126.com
    Participant

    Thank you so much for your reply!
    I tried this method but there still seems to be some problem, could you please help me further?

    1. To begin with, I defined two thermal omegas from two different converters.
    Codes:
    T Tomega = converter.getLatticeThermalRelaxationFrequency();
    T SolidOmega = converterSolid.getLatticeThermalRelaxationFrequency();
    2. Then, I restated the AdvectionDiffusionBGKdynamics for Solid in the header file ‘advectionDiffusionDynamics.h’.
    Codes:
    template<typename T, typename DESCRIPTOR, typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
    using LocalOmegaAdvectionDiffusionBGK = dynamics::Tuple<
    T,DESCRIPTOR,
    MOMENTA,
    equilibria::FirstOrder,
    collision::OmegaFromCell<collision::BGK>,
    AdvectionDiffusionExternalVelocityCollision
    >;
    3. Thirdly, I define the Dynamics for (1=fluid, 5=solid)
    Codes:
    ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry,1);
    ADlattice.defineDynamics<LocalOmegaAdvectionDiffusionBGK>(superGeometry,5);
    4. During the process of ‘set boundary’ and ‘define initial conditions’, everything is basically according to the original code. But when I enter the following definition, there is a problem reporting an error ‘Overloaded functions that do not match the argument list’.
    Codes:
    ADlattice.defineField<descriptors::OMEGA>(superGeometry.getMaterialIndicator({5}),SolidOmega);

    It’s worth noting that the fluid’s Omega has been set to ‘Tomega’.
    Am I doing this correctly and is there something I am missing that is preventing the program from working properly?
    Very much looking forward to your reply, which is highly appreciated!

    Best regards,
    Jethan

    #8041
    Adrian
    Keymaster

    The only issue I see is that you try to directly pass the T SolidOmega to defineField. While such an overload would be useful it currently doesn’t exist – you’ll need to create a constant analytical functor with value SolidOmega and pass it to defineField instead of SolidOmega.

    I’d also suggest to use LocalOmegaAdvectionDiffusionBGK for both material 1 and 5 and vary the omega paramter purely via the field (otherwise it will be very easy to accidentally use the wrong parameters, if everything is in a field you can simply check in VTK output – another advantage of this new approach).

    #8094
    Inko0521@126.com
    Participant

    Thank you for your quick reply!

    OpenLB is an excellent software, thanks again to you and all the developers!

    Best wishes!

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