|
[Sponsors] |
October 9, 2009, 11:10 |
Problems with own LES Model Implementation
|
#1 |
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18 |
I added a new subgrid scale model to my OpenFoam. Everything works fine except one thing. In detail it is a vegetation model, which adds a drag term to NS-Equation. So I modified the divDefBeff function with a additional term. Now I want to write out this term. Because the term is treat implicit I have to provide en explicit calculation right? So my current implementation looks like this:
I created a new field: force_ ( IOobject ( "force", runTime_.timeName(), mesh_, IOobject::NO_READ, IOobject::AUTO_WRITE ), a*mag(U)*U ) and update it, everytime sgsModel->correct is called: void myModel::correct(const tmp<volTensorField>& gradU) { GenEddyVisc::correct(gradU); // Calculate force force_=a*mag(U())*U(); // Calculate numeric viscosity ... } But this implementation sucks because if I make further changes on my force term, I have to remember 3 places (2 shown in the code above, 1 in divDevBeff) where I have to change the code. So may be anybody, with better C++ knowledge than me, could help me to find a more useful solution. kind regards, Fabian |
|
October 9, 2009, 11:31 |
|
#2 |
Senior Member
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18 |
Allright I had some luck and now I am able to reduce the occurance of the equation. If I initialize my volVectorField with zero:
force_ ( IOobject ( "force", runTime_.timeName(), mesh_, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh_, dimensionedVector("force_",dimensionSet(0,1,-2,0,0,0,0),vector(0,0,0)) ) It looks much better. But may be there is still some room for futher improvments? kind regards Fabian |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
v2f model implementation for airfoil in FLUENT | Sunil | FLUENT | 4 | December 7, 2016 19:17 |
non-linear k-epsilon model implementation problems | Saidi | Main CFD Forum | 2 | March 4, 2010 14:23 |
help urgent LES model for a swimming pool | marion | FLUENT | 0 | June 4, 2007 06:26 |
How to the taw(kk) in Les SGS model? | aiya | Main CFD Forum | 0 | August 11, 2006 11:21 |
LES turbulence model problem-HELP | James Willie | FLUENT | 2 | August 23, 2005 05:54 |