|
[Sponsors] |
June 18, 2009, 05:36 |
DDES implementation
|
#1 |
Member
Leonardo Giampani Morita
Join Date: Apr 2009
Location: Paris, France
Posts: 58
Rep Power: 16 |
Hello everybody,
I'm trying to implement a DDES model based on Spalart-Allmaras model from OF-1.5. However, I've never worked with C++ before, I only know C. I took a look into some models code already implemented in OF, but I still have some questions, so I would be very happy if anyone could help me a little. 1. the basic difference of DDES from DES is the definition of the distance d~: d~ = d - fd*max(0, d - CDES*delta) fd = 1 - tanh([8rd]^3) rd = (nut + nu)/((sqr(Ui,j*Ui,j))*(kappa*d)^2) where Ui,j represents the velocity gradient and other variables are the same as in DES, accordingly to Spalart et al. (A New version of Detached-Eddy Simulation, Resistant to Ambiguous Grid Densities) 2. so I think one should - declarate the new variables in the SpalartAllmaras.H - initialize them in the constructors - add the new definition of d~ in the if (mesh_.changing()) {...} (line 237 from SpalartAllmaras.C) 3. my questions: - should one call rd and fd as rd_ and fd_? - should they be declared as volScalarField rd_ and volScalarField fd_? - in the constructors, I added rd_((nuSgs_ + nu())/(mag(gradU)*pow(kappa_*wallDist(mesh_).y(),2))), fd_(1 - tanh(pow(8*rd_,3))), dTilda_(wallDist(mesh_).y() - fd_*max(0, wallDist(mesh_).y() - CDES_*delta())), but it seems that gradU should also be declared/initialized. How should I do that if gradU is a calculated variable? Or should I initialize them in the constructors in another way? - in the ProgrammersGuide,it's said that the velocity gradient should be called grad(U), but in the SpalartAllmaras code I found it being called as gradU. What would be the difference? gradU would be a kind of simplified representation of grad(U)? - is there any other big change I have to do, not listed in 2? 4. when I try to compile it, I get some errors, like the non-declaration of gradU and the following: SpalartAllmaras2/SpalartAllmaras2.C:224: error: no matching function for call to ‘max(int, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >)’ (refering to max(0, wallDist(mesh_).y() - CDES_*delta())) In addition, I get lots of similar messages like: /model/giampani/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/label.H:190: note: candidates are: char Foam::max(char, char) What would they mean? Thank you very much, Leonardo |
|
June 26, 2009, 09:31 |
|
#2 |
Member
Leonardo Giampani Morita
Join Date: Apr 2009
Location: Paris, France
Posts: 58
Rep Power: 16 |
For practical reasons I'll maybe keep my code at
~/OpenFOAM/<user>-<version>/src/turbulenceModels/hybrid/SpalartAllmaras2 separated from original code. I've created a Make/files file: *************************************** hybrid/SpalartAllmaras2/SpalartAllmaras2.C libMyTurbulenceModels.C LIB = $(FOAM_USER_LIBBIN)/libMyTurbulenceModels *************************************** and a Make/options file (identical to original one): *************************************** EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I../LESdeltas/lnInclude \ -I../LESfilters/lnInclude \ -I$(LIB_SRC)/transportModels LIB_LIBS = \ -lLESdeltas \ -lLESfilters\ -lfiniteVolume \ -lmeshTools *************************************** I've also created a libMyTurbulenceModels.C file, exactly like I had done for libfoamUser.C when implemented a boundary condition (note that I actually don't know if it is necessary...): *************************************** namespace Foam { void libMyTurbulenceModels() {} } // End namespace Foam *************************************** However, I don't know if it is possible to use member functions from turbulenceModel class, since my code will be compiled separatelly from original models. So I'd like to know if it is possible to do what I want to and, in the case it isn't too complicated, what should I add to my files. Thank you very much! |
|
July 28, 2009, 15:40 |
|
#3 |
Senior Member
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19 |
Hi Leonardo,
you saw probably the model in version 1.6!? Regards! FAbian |
|
July 28, 2009, 15:46 |
|
#4 |
Member
Leonardo Giampani Morita
Join Date: Apr 2009
Location: Paris, France
Posts: 58
Rep Power: 16 |
Great!
I'll take a look into it as soon as possible! Regards |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ddes | Matteo85 | OpenFOAM Running, Solving & CFD | 0 | March 26, 2009 07:43 |
Please explain the implementation of species transport Eqn in reactingFoam | kallipygian | OpenFOAM Running, Solving & CFD | 0 | October 13, 2008 07:29 |
Implementation details of SST k-omega model | Niels | Main CFD Forum | 3 | July 3, 2008 17:45 |
FEM Implementation of pressure-correction scheme | Markus | Main CFD Forum | 4 | January 6, 2007 01:53 |
Implementation of wall function with SA model | Bala | Main CFD Forum | 0 | October 7, 2004 23:54 |