|
[Sponsors] |
August 18, 2016, 06:57 |
Modification in Deardorff SGS
|
#1 |
Senior Member
Ehsan
Join Date: Mar 2009
Posts: 112
Rep Power: 17 |
Hello,
We try to add a formula based on the gradient of velocity in the Deardorff stress model and develop a model (Modulated Gradient model). However, we encounter the errors that is attached. I would be regretful if someone could advice us in this issue, because as soon as we add a few lines of: const volSymmTensorField Gij_ ( Gij_.component(symmTensor::XX) = ((sqr(delta())/12.0)*(fvc::grad(U).component(tensor::XX)*fvc::gra d(U).component(tensor::XX)))+((sqr(delta())/12.0)*(fvc::grad(U).component(tensor::XY)*fvc::gra d(U).component(tensor::XY)))+((sqr(delta())/12.0)*(fvc::grad(U).component(tensor::XZ)*fvc::gra d(U).component(tensor::XZ))); ); in the void MyDeardorffDiffStress::correct(const tmp<volTensorField>& gradU) the attached error appears. Regards |
|
August 18, 2016, 08:03 |
|
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
the first problem is that the field U is not available in your function. So you can not call fvc::grad(U). What you can do is replacing fvc::grad(U) by gradU. Another way is to get access to the U field by taking it from the registry database from OpenFOAM and build the gradU field again (but in my opinion this would be senseless if you already have gradU available). There are other mistakes you made but just one hint. Think about your code: calling fvc::grad(U) six times is just waste of computational resources. Call it once, save that field and use that field or just use the gradU that is already available. PS: Use Code-tags.
__________________
Keep foaming, Tobias Holzmann |
|
August 19, 2016, 08:40 |
|
#3 |
Senior Member
Ehsan
Join Date: Mar 2009
Posts: 112
Rep Power: 17 |
Thank you. We move in this direction but now the code do not understand component command for gradU, as the attached file depicts.
|
|
August 19, 2016, 15:25 |
|
#4 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Okay,
you are using this field: Code:
void MyDeardorffDiffStress::correct(const tmp<volTensorField>& gradU) Then you can search for volTensorField. Here you will realize that this is derived from a GeometricField. So you check the GeometricField class. Here you will find a lot of functions. The function you can call is component. So you can do something like that: Code:
tmp< GeometricField< cmptType, PatchField, GeoMesh > > theComponents = gradU.component(); Code:
scalar oneComponent = gradU[0].component().xx(); or scalar oneComponent = gradU[0].component()[0] Hope you get some further steps. Another way is to search the source code for the volTensorFields and hope that you get to a part where you find what you need Have a nice weekend.
__________________
Keep foaming, Tobias Holzmann |
|
August 20, 2016, 13:34 |
|
#5 |
Senior Member
Ehsan
Join Date: Mar 2009
Posts: 112
Rep Power: 17 |
Thank you!
We tried lot of combinations, all our trials and their errors are put in a doc file here: https://fumdrive.um.ac.ir/index.php/s/VqX1vK0FbbkFST3 1- Here, I attached the error of applying the lines attached in "Lines" image below as file "Error" 2- Once we tried the other command you suggested: tmp< GeometricField< cmptType, PatchField, GeoMesh > > theComponents = gradU.component();
the "error2" appears. I'd be more than happy if you help us in this regards. Ehsan |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compressible vs incompressible SGS model! | zhangyan | Main CFD Forum | 10 | June 4, 2016 05:39 |
Issues on modelling of isotropic part of Reynolds (SGS) stresses | Likun | OpenFOAM Programming & Development | 2 | January 25, 2016 03:51 |
Smagorinsky Sub-Grid Turbulence Model vs. Deardorff | oksero | Main CFD Forum | 4 | July 29, 2015 11:43 |
How to exploit SGS kinetic energy with Smagorinsky model in LES | babakflame | OpenFOAM Programming & Development | 3 | December 14, 2014 07:58 |
What is really SGS dissipation term in LES? | mrf6166 | Main CFD Forum | 0 | January 5, 2014 07:57 |