Cnojugated Heat Transfer
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Cnojugated Heat Transfer
- This topic has 6 replies, 3 voices, and was last updated 9 months, 3 weeks ago by Inko0521@126.com.
-
AuthorPosts
-
January 22, 2023 at 10:25 am #7132Henderson_CParticipant
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,
January 23, 2023 at 4:32 pm #7134AdrianKeymasterCan 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.December 13, 2023 at 5:31 am #8019Inko0521@126.comParticipantHello 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,
JethanDecember 13, 2023 at 10:36 am #8021AdrianKeymasterYes, 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
astemplate<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.
December 15, 2023 at 10:50 am #8040Inko0521@126.comParticipantThank 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,
JethanDecember 15, 2023 at 11:36 am #8041AdrianKeymasterThe only issue I see is that you try to directly pass the
T SolidOmega
todefineField
. While such an overload would be useful it currently doesn’t exist – you’ll need to create a constant analytical functor with valueSolidOmega
and pass it todefineField
instead ofSolidOmega
.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).December 19, 2023 at 5:04 am #8094Inko0521@126.comParticipantThank you for your quick reply!
OpenLB is an excellent software, thanks again to you and all the developers!
Best wishes!
-
AuthorPosts
- You must be logged in to reply to this topic.