Curved boundary
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Curved boundary
- This topic has 13 replies, 3 voices, and was last updated 3 weeks, 3 days ago by Adrian.
-
AuthorPosts
-
November 4, 2024 at 6:31 am #9466BranParticipant
Dear community:
I want to apply the wall function to the curved boundary. I tried this:sLattice.defineDynamics<ExternalTauEffLESForcedBGKdynamics>(superGeometry, 2); setWallFunctionBoundary<T,DESCRIPTOR>(sLattice, superGeometry, 2, converter, wallFunctionParam);
It reports the curved area can’t setWallFunctionBoundary. It seems that it can’t get the discreteNormal.
[setWallFunctionBoundary] Warning: Could not setWallFunctionBoundary (120, 0, 43), discreteNormal=(0,0,0,0), set to bounceBack
How can I solve this problem. The following is the geometry I got.
Danke!
- This topic was modified 1 month ago by Bran.
November 6, 2024 at 10:42 am #9483FBukreevKeymasterHello,
you need to apply correct wall model parameters.
‘template
struct wallFunctionParam {
/* Used method for density reconstruction
* 0: Zou-He (only for straight wall)
* 1: extrapolation (0th order)
* 2: constant (rho = 1.)
*/
int rhoMethod = 1;/* Used method for non-equilibrium particle distribution reconstruction
* 0: regularized NEBB (Latt, BounceBack, use for straight walls)
* 1: extrapolation NEQ (Guo Zhaoli, more precise, less stable)
* 2: regularized second order finite Differnce (for straight walls)
* 3: equilibrium scheme (less precise, more stability)
*/
int fneqMethod = 1;/* Used wall profile
* 0: Musker profile
* 1: power law profile
*/
int wallProfile = 0;/// check if descriptor with body force is used
bool bodyForce;/// special formulation for straight boundaries
bool curved = true;/// use van Driest damping function in boundary cell, stabilizes LES
bool useVanDriest = true;/// von Karman constant for van Driest model (~0.3-0.5)
T vonKarman = 0.375;/// distance from cell to real wall in lattice units
T latticeWalldistance = 0.5;
};’Choose the options for curved walls.
November 6, 2024 at 1:48 pm #9489BranParticipantThanks for your reply. I did so, but it doesn’t work. I mainly follow the channel3d case to do so, except I changed the geometry and I also set the
wallFunctionParam.curved = true
.
I don’t think it is the wall model parameters problem. It just can’t calculate the discreteNormal, I don’t know how to solve this problem.November 6, 2024 at 1:53 pm #9490FBukreevKeymasterYou can tray to use rhoMethod=2 and fneqMethod=3 there.
November 7, 2024 at 3:36 am #9493BranParticipantStill doesn’t work, only this part, can’t be setWallfunctionboundary.
Following is how I create the geometry:STLreader<T> Hump( "Hump.stl", converter.getConversionFactorLength(), 1, 1); CuboidGeometry3D<T> cuboidGeometry(Hump, converter.getPhysDeltaX(), noOfCuboids); cuboidGeometry.setPeriodicity(true, false, true); HeuristicLoadBalancer<T> loadBalancer(cuboidGeometry); SuperGeometry<T,3> superGeometry(cuboidGeometry, loadBalancer); prepareGeometry(superGeometry, Hump, converter);
void prepareGeometry(SuperGeometry<T,3>& superGeometry, IndicatorF3D<T>& Hump, UnitConverter<T,DESCRIPTOR> const& converter) { OstreamManager clout(std::cout,"prepareGeometry"); clout << "Prepare Geometry ..." << std::endl; superGeometry.rename(0,2,Hump); superGeometry.rename(2,1,{0,1,0}); superGeometry.clean(); superGeometry.innerClean(); superGeometry.checkForErrors(); superGeometry.print(); olb::Vector<T, 3> PhyMax = superGeometry.getStatistics().getMaxPhysR(2); olb::Vector<T, 3> PhyMin = superGeometry.getStatistics().getMinPhysR(2); clout << "Dimension of the channel in meters: x = " << PhyMax[0] - PhyMin[0]; clout << " ; y = " << PhyMax[1] - PhyMin[1]; clout << " ; z = " << PhyMax[2] - PhyMin[2] << std::endl; clout << "Prepare Geometry ... OK" << std::endl; }
- This reply was modified 4 weeks, 1 day ago by Bran.
November 7, 2024 at 11:06 am #9501FBukreevKeymasterWith the wall function in this release you can try to make this hump in the prepareGeometry section with a separate indicator and then rename all material number 1 cells to material number 2 inside of that hump indicator. By me, that has worked now.
November 11, 2024 at 10:41 am #9511BranParticipantThank you.
I didn’t make it. Could you please give an example so that I can learn how to do this right? I kind of can’t understand how thediscreteNormal
was calculated. I also tried inclined channel, the same problem appears. It seems that if there are more than one layer geometry whosematerial
are 0 around the boundary, then thedicreteNormal
won’t be set properly.
November 11, 2024 at 12:17 pm #9512FBukreevKeymasterYes, material 0 is the problem here.
You just leave the channelas it is in the main method and create a cylinder in the prepareGeometry section like:
IndicatorCylinder3D
cyl(center1, center2, radius);
superGeometry.rename(1,2,cyl);November 12, 2024 at 11:24 am #9513BranParticipantDo you mean doing these steps? It will make the whole domain become
material
0.STLreader<T> Hump("Hump.stl", converter.getConversionFactorLength(), 1, 1); IndicatorLayer3D<T> extendedDomain(Hump, converter.getConversionFactorLength()); CuboidGeometry3D<T> cuboidGeometry(extendedDomain, converter.getPhysDeltaX(), noOfCuboids); cuboidGeometry.setPeriodicity(true, false, true); HeuristicLoadBalancer<T> loadBalancer(cuboidGeometry); SuperGeometry<T,3> superGeometry(cuboidGeometry, loadBalancer); prepareGeometry(superGeometry, extendedDomain, Hump, converter);
void prepareGeometry(SuperGeometry<T,3>& superGeometry, IndicatorF3D<T>& extendedDomain, STLreader<T>& Hump, UnitConverter<T,DESCRIPTOR> const& converter) { OstreamManager clout(std::cout,"prepareGeometry"); clout << "Prepare Geometry ..." << std::endl; superGeometry.rename(0,2,extendedDomain); superGeometry.rename(1,2,Hump); superGeometry.clean(); superGeometry.innerClean(); superGeometry.checkForErrors(); superGeometry.print(); clout << "Prepare Geometry ... OK" << std::endl; }
This is how my stlfile looks like.
- This reply was modified 3 weeks, 3 days ago by Bran.
November 12, 2024 at 11:26 am #9515FBukreevKeymasterI mean do not use stl, generate geomnetry only with indicators.
November 12, 2024 at 11:36 am #9516BranParticipantHow can I generate this hump with indicator? For inclined channel, also with indicators?
November 12, 2024 at 11:37 am #9517FBukreevKeymastercombining the indicators. Cuboid – cylinder.
November 12, 2024 at 11:55 am #9518BranParticipantIt is not a regular cylinder, but an irregular shape, can openlb do this?
November 12, 2024 at 11:59 am #9519AdrianKeymasterYes, using indicators you can describe non-primitive geometries. Either by combining primitives into more complex setups using indicator arithmetic as Fedor suggested or by importing STL(s) using the
STLreader
indicator. The basic usage of indicators for constructing geometries is also detailed in the user guide. -
AuthorPosts
- You must be logged in to reply to this topic.