Compatibility of setZeroGradientBoundary with D2Q5<VELOCITY, SOU
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Compatibility of setZeroGradientBoundary with D2Q5<VELOCITY, SOU
- This topic has 3 replies, 2 voices, and was last updated 1 day, 20 hours ago by taki.
-
AuthorPosts
-
October 30, 2024 at 7:58 am #9452takiParticipant
Hello everyone!
I’m trying to understand if
setZeroGradientBoundary<T, TDESCRIPTOR>
can be used withD2Q5<VELOCITY, SOURCE>
.I’ve noticed that
setAdvectionDiffusionTemperatureBoundary<T, TDESCRIPTOR>
works fine, but I’m curious whysetZeroGradientBoundary
might not.Could someone clarify this for me?
Thank you very much!
- This topic was modified 6 days, 3 hours ago by taki.
October 30, 2024 at 4:57 pm #9457AdrianKeymasterDid you take a look yourself and test the same way you tested the ADE temperature boundary?
Without knowing more details one can not tell you whether any BC works for your specific application or not.
October 31, 2024 at 5:44 am #9458takiParticipantI have tested the ADE temperature boundary condition.
I would like to set the outflow to Neumann.
I’m getting the error: ‘setZeroGradientBoundary’ was not declared in this scope. I’d like some advice on how to resolve this.void prepareLattice(SuperLattice<T, TDESCRIPTOR>& ADlattice, SuperGeometry<T, 2>& superGeometry, T rho, AdeUnitConverter<T, TDESCRIPTOR> converter) { OstreamManager clout(std::cout, "prepareLattice"); clout << "Prepare Lattice ..." << std::endl; const T omega = converter.getLatticeAdeRelaxationFrequency(); ADlattice.defineDynamics<SourcedAdvectionDiffusionBGKdynamics>(superGeometry, 1); AnalyticalConst2D<T, T> u(converter.getLatticeVelocity(flow_rate), converter.getLatticeVelocity(0.0)); AnalyticalConst2D<T, T> rho0_(converter.getLatticeDensity(rho)); // Setting of the boundary conditions, inflow, and outflow with Dirichlet condition setAdvectionDiffusionTemperatureBoundary<T, TDESCRIPTOR>(ADlattice, superGeometry.getMaterialIndicator(3)); <strong>setZeroGradientBoundary<T, TDESCRIPTOR>(ADlattice, superGeometry.getMaterialIndicator({4}));</strong> //setAdvectionDiffusionTemperatureBoundary<T, TDESCRIPTOR>(ADlattice, superGeometry.getMaterialIndicator(4)); ADlattice.setParameter<descriptors::OMEGA>(omega); auto bulkIndicator = superGeometry.getMaterialIndicator(1); auto everywhere = superGeometry.getMaterialIndicator({1, 2, 3, 4}); // Setting flowrate inside reactor, as well as initial concentrations ADlattice.defineField<descriptors::VELOCITY>(everywhere, u); ADlattice.defineField<descriptors::SOURCE>(bulkIndicator, rho0_); ADlattice.defineRho(bulkIndicator, rho0_); ADlattice.iniEquilibrium(superGeometry, 1, rho0_, u); // Setting actual values for the boundary ADlattice.defineRho(superGeometry, 3, rho0_); ADlattice.iniEquilibrium(superGeometry, 3, rho0_, u); ADlattice.defineRho(superGeometry, 4, rho0_); ADlattice.iniEquilibrium(superGeometry, 4, rho0_, u); // Make the lattice ready for simulation ADlattice.initialize(); clout << "Prepare Lattice ... OK" << std::endl; }
November 3, 2024 at 3:08 pm #9463takiParticipantI haven’t been able to solve it yet, so I would appreciate it if someone could answer.
Thanks! -
AuthorPosts
- You must be logged in to reply to this topic.