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

How to code the the coupling of velocity and concentration fluctuations?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By agustinvo

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 13, 2019, 09:25
Default How to code the the coupling of velocity and concentration fluctuations?
  #1
Member
 
Pedro Ramos
Join Date: Mar 2012
Location: Belgium
Posts: 81
Rep Power: 14
pedroxramos is on a distinguished road
Hi,

to study the fluctuations of the velocity and the fluctuations of the concentration of a passive scalar, I've inserted this in my controlDict file:
fieldAverage
{
type fieldAverage;
functionObjectLibs ( "libfieldFunctionObjects.so");
[...]
fields
(
U
{
mean on;
prime2Mean on;\leftarrow
base time;
}
s
{
mean on;
prime2Mean on;\leftarrow
base time;
}
);
}
#includeFunc scalarTransport


As you know, this will give me U_prime2mean and s_prime2mean (indicated with arrows)

Now, I want to couple both fluctuations and get uprime_sprime_mean.
Does anyone know how?
pedroxramos is offline   Reply With Quote

Old   December 15, 2019, 16:45
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,


maybe you can use the new fields and use a calc function. E.g.
Code:
postProcess -func calc ...

It might also work on the fly, by using the calc function directly inside the controlDict but for this, the new generated fields should be registered in the database. Out of the box, I am not sure, if this can be done on the fly.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   December 15, 2019, 16:53
Default
  #3
Member
 
Pedro Ramos
Join Date: Mar 2012
Location: Belgium
Posts: 81
Rep Power: 14
pedroxramos is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi,


maybe you can use the new fields and use a calc function. E.g.
Code:
postProcess -func calc ...

It might also work on the fly, by using the calc function directly inside the controlDict but for this, the new generated fields should be registered in the database. Out of the box, I am not sure, if this can be done on the fly.
Tobias, thanks, but I'm afraid a postProcessing tool won't work because i want the fluctuations throughout time...
pedroxramos is offline   Reply With Quote

Old   December 16, 2019, 06:50
Default
  #4
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Hi Pedro,
I faced the same problem when performing LES. I think you want to do something similar, isn't it?


What you would need is to create a functionObject that reads U, UMean and T,TMean and computes
ut=(U-UMean)*(T-TMean)


You can do this, of course, directly in your solver by calling TMean and UMean, defining ut...


In my case I went farther (other turbulent statistics) and I modified a function object in order to generate the fluctuating fields.
pedroxramos likes this.
agustinvo is offline   Reply With Quote

Old   December 16, 2019, 07:22
Default
  #5
Member
 
Pedro Ramos
Join Date: Mar 2012
Location: Belgium
Posts: 81
Rep Power: 14
pedroxramos is on a distinguished road
Gracias, Agustín!

do you mean I need to write a separate solver (copy-paste the files of an existent one) and adapt two things:
In the fields.H file, all variables are defined. I can add my new variable there;
In the solver, in the while loop of the time, after the flow equations are solved, add the operation for you new variable. For example: newVariable = c * U;

is this your suggestion?
pedroxramos is offline   Reply With Quote

Old   December 16, 2019, 07:25
Default
  #6
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
De nada Pedro


Yes, it is. Remember that you must include not only ut, but also UMean and TMean in your new solver. You can run it as you prefer, but please wait until you have a converged UMean and TMean!
agustinvo is offline   Reply With Quote

Old   December 16, 2019, 07:34
Default
  #7
Member
 
Pedro Ramos
Join Date: Mar 2012
Location: Belgium
Posts: 81
Rep Power: 14
pedroxramos is on a distinguished road
Yes, ok, but I already get that from here:

U
{
mean on;
prime2Mean on;\leftarrow
base time;
}

no?
pedroxramos is offline   Reply With Quote

Old   December 16, 2019, 07:50
Default
  #8
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Effectively. You must run first a simulation averaging U and T (with your usual solver), and once UMean and TMean have converged you can use the second solver.
agustinvo is offline   Reply With Quote

Old   December 16, 2019, 07:51
Default
  #9
Member
 
Pedro Ramos
Join Date: Mar 2012
Location: Belgium
Posts: 81
Rep Power: 14
pedroxramos is on a distinguished road
aaaaah, I get it now, thanks a lot!!!
pedroxramos is offline   Reply With Quote

Old   January 22, 2020, 08:41
Smile
  #10
Member
 
Pedro Ramos
Join Date: Mar 2012
Location: Belgium
Posts: 81
Rep Power: 14
pedroxramos is on a distinguished road
Quote:
Originally Posted by agustinvo View Post
Hi Pedro,
I faced the same problem when performing LES. I think you want to do something similar, isn't it?


What you would need is to create a functionObject that reads U, UMean and T,TMean and computes
ut=(U-UMean)*(T-TMean)


You can do this, of course, directly in your solver by calling TMean and UMean, defining ut...


In my case I went farther (other turbulent statistics) and I modified a function object in order to generate the fluctuating fields.
Agustín, thanks a lot. I also want to do a quadrant analysis with the uRMS, so I also need to sabe the fluctuating fields. Would you mind sharing your function object?
pedroxramos is offline   Reply With Quote

Old   February 24, 2020, 09:30
Default
  #11
Member
 
Pedro Ramos
Join Date: Mar 2012
Location: Belgium
Posts: 81
Rep Power: 14
pedroxramos is on a distinguished road
Quote:
Originally Posted by pedroxramos View Post
Tobias, thanks, but I'm afraid a postProcessing tool won't work because i want the fluctuations throughout time...

hi again, I'm still having some problems with this, would you mind sharing your scripts?
pedroxramos is offline   Reply With Quote

Reply

Tags
average field, concentration, fluctuations, passive scalar


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
dispersion with radial velocity CharlineF OpenFOAM Programming & Development 3 September 13, 2019 13:24
Unsteady field advected by steady velocity field t.oliveira OpenFOAM Running, Solving & CFD 2 December 28, 2015 14:42
Velocity from varying particle's concentration nombood Fluent Multiphase 2 April 25, 2014 10:32
velocity in diffusion process reyeszjj Main CFD Forum 1 March 21, 2010 04:24
How to solve velocity & concentration seperately? Cloudy Phoenics 5 March 11, 2002 23:13


All times are GMT -4. The time now is 16:06.