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

Problems with own LES Model Implementation

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 9, 2009, 10:10
Default Problems with own LES Model Implementation
  #1
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 182
Rep Power: 8
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, 10:31
Default
  #2
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 182
Rep Power: 8
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
v2f model implementation for airfoil in FLUENT Sunil FLUENT 2 January 16, 2014 08:15
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 05:26
How to the taw(kk) in Les SGS model? aiya Main CFD Forum 0 August 11, 2006 10:21
LES turbulence model problem-HELP James Willie FLUENT 2 August 23, 2005 04:54


All times are GMT -4. The time now is 09:55.