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

Ek decay

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 31, 2006, 17:59
Default I am trying to adjust dnsFoam
  #1
New Member
 
Mick Calma
Join Date: Mar 2009
Posts: 5
Rep Power: 17
michso is on a distinguished road
I am trying to adjust dnsFoam to calculate the decay of turbulence (in space). For that, in my domain (say 32, 16, 16 - with inlet bc) the turbulence forcing is active in the first half only (1:16,1:16,1:16), the other part should be calculated without the extra source term. How can I do that in a compact and elegant way? Some CFD codes allow to define different fluid zones, is that a case with OF? I've got no experience with OF and need some help

Regards,
Mick
michso is offline   Reply With Quote

Old   July 31, 2006, 18:17
Default A possible way to do this (far
  #2
Member
 
diablo80@web.de
Join Date: Mar 2009
Posts: 93
Rep Power: 17
sampaio is on a distinguished road
A possible way to do this (far from clever, tough ) is to create a new scalar field (say, alpha) to act like a switch:
it is 0 outside your forcing subdomain and 1 inside.

Then you set the initial conditions accordingly and never change this variable (alpha).

In the main code, you multiply alpha by the force, and that's it.

Cheers,
luiz
sampaio is offline   Reply With Quote

Old   July 31, 2006, 18:17
Default Please post your message under
  #3
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Please post your message under one topic only.

Mattijs
mattijs is offline   Reply With Quote

Old   August 1, 2006, 07:12
Default Luiz, That's indeed my questi
  #4
New Member
 
Mick Calma
Join Date: Mar 2009
Posts: 5
Rep Power: 17
michso is on a distinguished road
Luiz,
That's indeed my question. How to create such a scalar field to be 1 in the first half of the domain and 0 in the second. Could you give me an example?

Regards,
Mick
michso is offline   Reply With Quote

Old   August 1, 2006, 08:13
Default Add your switch variable (alph
  #5
Member
 
diablo80@web.de
Join Date: Mar 2009
Posts: 93
Rep Power: 17
sampaio is on a distinguished road
Add your switch variable (alpha) to createFields.H

volScalarField alpha
(
IOobject
(
"alpha",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);


Your "0" directory must now contain initial value for this variable all over the domain. Set it to 0 over all domain and boundary conditions.

Then, create a auxiliar case, whose geometry is exactly that of your forcing subdomain. Construct such a case and set alpha = 1 in all this auxiliary geometry (case).

Use mapFields utility to map fields from the auxiliary case to the real one:

mapFields . auxiliar_case . real_case

This way, your variable alph (dont forget to alter mapFieldsDict accordingly) will now be 1 in the region coincident with the auxiliar case geometry and 0 elsewhere.

Then, run the case (real one)

Good luck
sampaio is offline   Reply With Quote

Old   August 1, 2006, 08:17
Default the setFields utility might be
  #6
Member
 
Pierre Le Fur
Join Date: Mar 2009
Location: UK
Posts: 60
Rep Power: 17
pierre is on a distinguished road
the setFields utility might be helpful. Have a look at the dam break tutorial for the interFoam solver. You can also look at the guide. Hope this helps.
pierre is offline   Reply With Quote

Old   August 1, 2006, 10:59
Default Luiz, Pierre, Thanks a lot fo
  #7
New Member
 
Mick Calma
Join Date: Mar 2009
Posts: 5
Rep Power: 17
michso is on a distinguished road
Luiz, Pierre,
Thanks a lot for your prompt reactions and valuable remarks. I think that now I will be able to go further with my project.

Cheerio,
M
michso is offline   Reply With Quote

Old   August 1, 2006, 17:24
Default Guys, What is great about our
  #8
New Member
 
Mick Calma
Join Date: Mar 2009
Posts: 5
Rep Power: 17
michso is on a distinguished road
Guys,
What is great about our life is that solving one problem creates at least 2 new ;-).
Anyway, I simply overlooked that Kmesh generates the forcing field based on the entire geometry. My idea is to generate non-zero forcing for the half of my domain only (e.g. 16 16 16) and solve the problem in a bigger domain (32 16 16). As mentioned in the first post I have got no experience with OF and rather little with C programming (especially using OF macros). Does anyone know how to fool Kmesh and consequently UOprocess to take only the half of my domain to generate forcing?

Regards,
Mick
michso 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
turbulent decay ricklee Main CFD Forum 18 March 7, 2007 10:10
Vortices Decay John Deas Main CFD Forum 0 January 4, 2007 13:49
Turbulence decay michso OpenFOAM Running, Solving & CFD 0 July 31, 2006 17:57
Source term for decay Chimwemwe FLUENT 0 February 6, 2005 13:43
Decay of Chlorine Dioxide Sankalp Main CFD Forum 0 September 9, 2004 01:40


All times are GMT -4. The time now is 10:04.