channel3d Taueff
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › channel3d Taueff
- This topic has 5 replies, 2 voices, and was last updated 5 months ago by liu.
-
AuthorPosts
-
September 26, 2024 at 6:11 am #9293liuParticipant
Dear OpenLB community,
I would like to ask in which function is the effective relaxation time of Taueff calculated in the case of channel3d, thank you very muchSeptember 29, 2024 at 11:15 am #9305liuParticipantnamespace detail {
template <typename COLLISION, typename DESCRIPTOR, typename MOMENTA, typename EQUILIBRIUM>
struct SmagorinskyEffectiveOmega {
using MomentaF = typename MOMENTA::template type<DESCRIPTOR>;
using CollisionO = typename COLLISION::template type<DESCRIPTOR, MOMENTA, EQUILIBRIUM>;template <typename CELL, typename PARAMETERS, typename V=typename CELL::value_t>
V computeEffectiveOmega(CELL& cell, PARAMETERS& parameters) any_platform {
V piNeqNormSqr { };
MomentaF().computePiNeqNormSqr(cell, piNeqNormSqr);
const V rho = MomentaF().computeRho(cell);
const V omega = parameters.template get<descriptors::OMEGA>();
std::cout << “omega1111111: ” << parameters.template get<descriptors::OMEGA>() << std::endl;
const V smagorinsky = parameters.template get<collision::LES::Smagorinsky>();
V piNeqNorm = util::sqrt(piNeqNormSqr);
V preFactor = smagorinsky*smagorinsky
* descriptors::invCs2<V,DESCRIPTOR>()*descriptors::invCs2<V,DESCRIPTOR>()
* 2 * util::sqrt(2);
/// Molecular realaxation time
V tauMol = V{1} / omega;std::cout << “tauMol: ” << tauMol << std::endl << std::flush;
/// Turbulent realaxation time
V tauTurb = V{0.5} * (util::sqrt(tauMol*tauMol + preFactor / rho * piNeqNorm) – tauMol);
std::cout << “tauTurb: ” << tauTurb << std::endl << std::flush;
/// Effective realaxation time
V tauEff = tauMol + tauTurb;
return V{1} / tauEff;
} Why can’t I output taueff here, thanksSeptember 29, 2024 at 12:53 pm #9306AdrianKeymasterYou are likely using this collision operator in a CSE-optimized context (e.g. using the
SmagorinskyBGKdynamics
tuple). This means that the code you modified won’t actually be executed during runtime. You can check without reading the code by adding#define DISABLE_CSE
before any OpenLB includes in your case.October 8, 2024 at 10:15 am #9331liuParticipantthank you, I’ve tried to include that code in the channel3d,“#define DISABLE_CSE”. But I found that I still can’t output taueff.
October 21, 2024 at 4:35 pm #9393AdrianKeymasterUnfortunately I can only continue to guess without seeing your code. Did you define the
DISABLE_CSE
flag before including any OpenLB headers? Are you actually using the Smagorinsky LES model you modified?Alternatively you can also store tau eff in a dedicated field and output this field as VTK.
October 23, 2024 at 3:09 am #9405liuParticipantthank you, I solved the problem using your method.
-
AuthorPosts
- You must be logged in to reply to this topic.