CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Problems with own LES Model Implementation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 9, 2009, 11:10
Default Problems with own LES Model Implementation
  #1
Senior Member
 
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18
fs82 is on a distinguished road
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
fs82 is offline   Reply With Quote

Old   October 9, 2009, 11:31
Default
  #2
Senior Member
 
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18
fs82 is on a distinguished road
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
fs82 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 05:31.