|
[Sponsors] |
Q: How to access turbulent production term G from TKE in scalarCodedSource |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 11, 2022, 06:51 |
Q: How to access turbulent production term G from TKE in scalarCodedSource
|
#1 |
Member
Kabir Shariff
Join Date: Oct 2016
Location: France
Posts: 53
Rep Power: 10 |
Hello,
I would like to implement a source term into k-epsilon model in a given location using the scalar coded source in fvOptions. I implemented the k source and it works fine, but the epsilon source term need the production term of the TKE, G. How can I get this term into the equation? The source term is given in the figure attached herewith. G.JPG Thank you. |
|
January 11, 2022, 09:47 |
|
#2 |
Senior Member
Julio Pieri
Join Date: Sep 2017
Posts: 109
Rep Power: 9 |
Is this field natively available by the solver?
You can check it by running a "dummy" functionObject that will give you an error and print all available fields: Code:
FIELDSAVAILABLE { type writeObjects; libs ("libfieldFunctionObjects.so"); executeControl writeTime; writeControl writeTime; objects ("HIMYFRIEND"); } If you can, you may access it with something like Code:
mesh().lookupObject<volScalarField>("FIELD"); If you can't, then you might need to re-write it from the other available fields |
|
January 11, 2022, 10:34 |
|
#3 | |
Member
Kabir Shariff
Join Date: Oct 2016
Location: France
Posts: 53
Rep Power: 10 |
Quote:
Hello, thanks for the reply, I checked the term is not listed in the available field list. the TKE production term G is defined in the KEps model as; It is defined in the .C fine as Code:
const volScalarField::Internal G(this->GName(), nut()*GbyNu); tgradU.clear(); Code:
// Turbulent kinetic energy equation tmp<fvScalarMatrix> kEqn ( fvm::ddt(alpha, rho, k_) + fvm::div(alphaRhoPhi, k_) - fvm::laplacian(alpha*rho*DkEff(), k_) == alpha()*rho()*G - fvm::SuSp((2.0/3.0)*alpha()*rho()*divU, k_) - fvm::Sp(alpha()*rho()*epsilon_()/k_(), k_) + kSource() + fvOptions(alpha, rho, k_) ); |
||
January 11, 2022, 10:52 |
|
#4 |
Senior Member
Julio Pieri
Join Date: Sep 2017
Posts: 109
Rep Power: 9 |
Hmm so this is harder. I'd try recreating this expression:
Code:
tgradU().v() && dev(twoSymm(tgradU().v())) * nut() As alternatives you could edit the code to make this variable accessible, or use swak4Foam that usually have access to more fields. Not sure how to use it for fvOptions though. |
|
January 11, 2022, 15:57 |
|
#5 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 746
Rep Power: 14 |
You are right Julio, but most of those terms (tgradU(), twoSymm(tgradU().v())) will not be stored on the registry, so you'll have to recreate them from the velocity field. Just follow the coding in the kEpsilon model, and you should be fine.
|
|
Tags |
fvoptions, kepsilon, scalarcodedsource, source term |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
scalarCodedSource how to access to field instance | samiahmed | OpenFOAM | 1 | June 30, 2019 21:51 |
How to access nu and nut values for a Turbulent Solver | suman91 | OpenFOAM Programming & Development | 9 | December 19, 2018 07:17 |
laplacian term in turbulent model | chai | OpenFOAM Running, Solving & CFD | 4 | March 8, 2012 10:28 |
ATTENTION! Reliability problems in CFX 5.7 | Joseph | CFX | 14 | April 20, 2010 16:45 |
Numerical method for the k-epsilon production term | carlslack | Main CFD Forum | 0 | January 23, 2003 17:13 |