|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Mick Calma
Join Date: Mar 2009
Posts: 5
Rep Power: 6 ![]() |
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 |
|
|
|
|
|
|
|
|
#2 |
|
Member
diablo80@web.de
Join Date: Mar 2009
Posts: 93
Rep Power: 6 ![]() |
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 |
|
|
|
|
|
|
|
|
#3 |
|
Super Moderator
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 13 ![]() |
Please post your message under one topic only.
Mattijs |
|
|
|
|
|
|
|
|
#4 |
|
New Member
Mick Calma
Join Date: Mar 2009
Posts: 5
Rep Power: 6 ![]() |
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 |
|
|
|
|
|
|
|
|
#5 |
|
Member
diablo80@web.de
Join Date: Mar 2009
Posts: 93
Rep Power: 6 ![]() |
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 |
|
|
|
|
|
|
|
|
#6 |
|
Member
Pierre Le Fur
Join Date: Mar 2009
Location: UK
Posts: 60
Rep Power: 6 ![]() |
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.
|
|
|
|
|
|
|
|
|
#7 |
|
New Member
Mick Calma
Join Date: Mar 2009
Posts: 5
Rep Power: 6 ![]() |
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 |
|
|
|
|
|
|
|
|
#8 |
|
New Member
Mick Calma
Join Date: Mar 2009
Posts: 5
Rep Power: 6 ![]() |
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 |
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| turbulent decay | ricklee | Main CFD Forum | 18 | March 7, 2007 09:10 |
| Vortices Decay | John Deas | Main CFD Forum | 0 | January 4, 2007 12:49 |
| Turbulence decay | michso | OpenFOAM Running, Solving & CFD | 0 | July 31, 2006 16:57 |
| Source term for decay | Chimwemwe | FLUENT | 0 | February 6, 2005 12:43 |
| Decay of Chlorine Dioxide | Sankalp | Main CFD Forum | 0 | September 9, 2004 00:40 |