https://linen.dev logo
Rtheta model correction
# les-ras
l
The only difference is a source term in the transport equation for Rethetat I believe
q
Okay,. and have you gone through the source code of kOmegaSSTLM? The good thing about openfoam is that the variables are named in english
Copy code
// Transition onset momentum-thickness Reynolds number equation
        tmp<fvScalarMatrix> ReThetatEqn
        (
            fvm::ddt(alpha, rho, ReThetat_)
          + fvm::div(alphaRhoPhi, ReThetat_)
          - fvm::laplacian(alpha*rho*DReThetatEff(), ReThetat_)
         ==
            Pthetat*ReThetat0(Us, dUsds, nu) - fvm::Sp(Pthetat, ReThetat_)
          + fvOptions(alpha, rho, ReThetat_)
        );
l
not at all
q
This above is the Rtheta eqn but there are also a bunch of other places in the same file where the variable is corrected in the file.. so, in order to make a correction, those need to be correlated to the math, so we know where to add your term
q
yes terms on LHS of the code I sent, those are the ddt, convection and diffusion terms in your equation, and the other one is Ptheta but it seems to be written in a different form (the equation seems to include ReTheta inside it) while in the code there is an expanded form calculating ReTheta_0 from other flow quantities
This is the new stuff afaik, with the 2015 implementation
q
lol dont send me symbols I am not going to write it XD
l
yeah yeah, I am just putting it here so we can look at it
lol
But you can see the new term, which is given with the stuff below
q
mm I think a starting point would be to compare Ptheta thingy in the original math, to the DSCF thingy in the new one... and side by side, look at the Ptheta *ReTheta_0 calculation in the code so you know what is to be changed
l
I am guessing OF just writes the long equation without splitting the operators into easier terms?
Atleast thats my guess
q
`` Pthetat*ReThetat0(Us, dUsds, nu)`` does a long calculation based on lambda and exponentials...
l
also OF I just realized is not a great abbreviation for OpenFOAM these days
q
foam
Copy code
Pthetat*ReThetat0(Us, dUsds, nu) - fvm::Sp(Pthetat, ReThetat_)
          + fvOptions(alpha, rho, ReThetat_)
q
``fvm::Sp(Pthetat, ReThetat_) + fvOptions(alpha, rho, ReThetat_)`` that is for additional terms...
your equation stops here" ``Pthetat*ReThetat0(Us, dUsds, nu)``
l
what
already lost me
q
wait
l
Copy code
tmp<fvScalarMatrix> ReThetatEqn
        (
            fvm::ddt(alpha, rho, ReThetat_)
          + fvm::div(alphaRhoPhi, ReThetat_)
          - fvm::laplacian(alpha*rho*DReThetatEff(), ReThetat_)
         ==
            Pthetat*ReThetat0(Us, dUsds, nu) - fvm::Sp(Pthetat, ReThetat_)
          + fvOptions(alpha, rho, ReThetat_)
        );
So this is the full equation, then I have a temporal term also in the equation and a spatial term as divergence as well. The laplacian is now only for additional source terms?
Because the == shows P_thetat and the diffusion part of the viscosity as well (i think)
q
Copy code
fvm::ddt(alpha, rho, ReThetat_)
          + fvm::div(alphaRhoPhi, ReThetat_)
          - fvm::laplacian(alpha*rho*DReThetatEff(), ReThetat_)
         ==
            Pthetat*ReThetat0(Us, dUsds, nu)
this corresponds to the four terms you mentioned. the fvOptions and fvm::Sp terms are extra for now
In the code, the laplacian has negative sign and goes to LHS, so it is simply a rerrangement of the terms so that the usual things are on the LHS (ddt, div and laplacian are common terms in all transport equations)
Essentially the ``Pthetat*Rthetat0()`` is what does the special tricks more or less... so we need to look at what it does. Here's ``Pthetat`` in this term:
Copy code
Pthetat(         alpha()*rho()*(cThetat_/t)*(1 - Fthetat));
and it is multiplied with a Rethetat0 which is a bunch of long-ass calculation
but the actual value of ReTheta0 comes down to something like this: `` ReThetat0[celli] = max(thetat*Us[celli]/nu[celli], scalar(20));`` where ``thetat`` comes from an iterative loop and ``Us`` etc are coming from local flow, I think
l
okay
q
My question for you is how does this correspond to the math side of Ptheta
the way it is written in the paper
l
you mean the original paper 2006/09?
q
base model
which is implemented here
l
looks accurate
No is it? I honestly dont know
q
mmm whats the notation... what is the tilde term?
l
tilde is the actual transport variable, Rethetat is an empirical correlation
q
but this notation is different
I also gave the OpenFOAM implementation to a LLM and it spat out this mathematical equation
q
aa okay yes.... I made a mistake when I sent you the equation code. `` Pthetat*ReThetat0(Us, dUsds, nu) - fvm::Sp(Pthetat, ReThetat_) `` These two terms together do that subtraction
Together they form the PthetaT shown here
but what you want is a different Ptheta
which combines this effect
THe new term looks similar to the Ptheta term earlier, so actual addition may look similar. But the main challenge is the components of this Dscf...
l
why would it combine this effect? I thought its not included yet as the D term comes from the 2015 expansion
q
The D term is diffusion (laplacian)
Okay look again at the equation in code:
Copy code
fvm::ddt(alpha, rho, ReThetat_)
          + fvm::div(alphaRhoPhi, ReThetat_)
          - fvm::laplacian(alpha*rho*DReThetatEff(), ReThetat_)
         ==
            Pthetat*ReThetat0(Us, dUsds, nu) - fvm::Sp(Pthetat, ReThetat_)
          + fvOptions(alpha, rho, ReThetat_)
The first three terms are time convection and diffusion.... (which are the terms 1,2 and 4 in the base equation)... The P term can be expanded into a difference of two terms... those are these two terms: `` Pthetat*ReThetat0(Us, dUsds, nu) - fvm::Sp(Pthetat, ReThetat_)`` ... the fvm::Sp is a way to write a source-term which implicitly has the transported variables
so your DSCF term has a similar form with ``Rscf - Rtheta`` so, in the code, it would probably take a form like so: `` Dscf*ReSCF(..) - fvm::Sp(Dscf, ReThetat_) `` does that make sense?
note that ``Dscf`` here is something like this: ``Pthetat( alpha()*rho()*(cThetat_/t)*(1 - Fthetat));`` meaning that it is the other terms apart from ReTheta terms...
so in the Dscf implementation we will have ``Dscf ( alpha()*rho()*(cscf_/t)*(1 - Fthetat2));`` where cscf is some constant value... and our final challenge is to calculate ``Ftheta2`` and ``Rscf``
this the ``Rscf`` term, so the main issue it to identify streamwise direction here.... and simialrly for ``Ftheta2`` there are some wake related parameters which I think are equations 15-20 in the correction paper
so you will basically need to write those down 😛
to be honest, its a good project 🙂
l
I already have a headache
q
something which I think you'll be able to do in a week or so
there goes my hopes of being any good at explaning things 😄
l
i just have a hard time with code
q
sorry to break your heart but at some points you need to do it if you want to work beyond the normal computing situations... Having said that, I would suggest to read the above thread at ease. there are hints on how you can look at the existing code in the file, and then add similar terms for newer physics...
l
yeah I know, I think I can do it but it will take some time to understand it
q
the aerospace challenge for you would be to find a way to determine streamwise direction to calculate your psi in your calculation
Feel free to ask away here or in #814043123810304041... people do help with the day to day struggles of coding up openfoam... for a starting point, look up a tutorial on how to build custom BC, or custom turbulence Model... make a copy of the kOmegaSSTLM as kOmegaSSTLennyGo... and try to make sure it gets detected in the list of available models... then you can go about messing inside it, without breaking anything
(Hint: do a search for every occurence of kOmegaSSTLM, and create an identical of every single thing called kOmegaSSTLennyGo
l
I think the biggest issue associated is that i will have to proove that it works. And... I think only wings exist for checking this crossflow term and I really dont wanna use Snappy
I would rather use a given mesh for validating it, but idk if I can get any
q
You could seek help from otaola if you know reference mesh diagrams
Also, anyone who proposes something is likely to say it's super important, and the next big solution. A more honest estimate is to see others in the field who tested it and whether they agreed that it was actually good.
2 Views