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

Calculating fluctuation flux (Reynolds flux) of scalar in LES?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 12, 2022, 02:15
Question Calculating fluctuation flux (Reynolds flux) of scalar in LES?
  #1
New Member
 
Shengjie Lu
Join Date: Sep 2020
Location: Nanjing,China
Posts: 11
Rep Power: 3
hhu_lulu is on a distinguished road
Hi FOAMer! I am using LES to simulate the scalar mixing in wall-bounded turbulent flow. The LES could calculate the transient velocity field U and scalar field s. With the fieldAverage function, the time-averaged value UMean and sMean could also be obtained.
Now I want to output the time-avearged flux and fluctuation flux of scalar, namely the <Us> and <U's'>, which requires to calculate the expression U*s and (U-UMean)*(s-sMean) and pass the result to fieldAverage function.
After searching through the forum, maybe the easiest way is to impose coded functionObject in controlDict file. I adapt the code in thread
HTML Code:
https://www.cfd-online.com/Forums/openfoam-post-processing/219817-fluctuating-component-scalar-quantity.html
to my case, but the simulation aborted in the middle of the process and the error shows:
Quote:
new cannot satisfy memory request.
This does not necessarily mean you have run out of virtual memory.
It could be due to a stack violation caused by e.g. bad use of pointers or an out of date shared library
BTW, I use the parallel computation on HPC.
Does anyone know the way to handle this, or any other workaround?
hhu_lulu is offline   Reply With Quote

Old   April 12, 2022, 02:25
Default
  #2
New Member
 
Shengjie Lu
Join Date: Sep 2020
Location: Nanjing,China
Posts: 11
Rep Power: 3
hhu_lulu is on a distinguished road
For quick reference, I post the adapted code below, in which the flux1 represents the product of U and s.
Code:
fluctuation_flux1
	{
		type			coded;
		libs			("libutilityFunctionObjects.so");
		enabled		true;
		timeStart		74;
		timeEnd		200;
		writeControl	adjustableRunTime;
		writeInterval	200;
		name		fluctuation_flux1;
		
		codeExecute
		#{
			const volVectorField& U = 
                        mesh().lookupObject<volVectorField>("U");		
			const volScalarField& s = 
                        mesh().lookupObject<volScalarField>("s");		
			
			obr_.store
			(
				new	volVectorField	
				(
					IOobject
					(
						"flux1",
						obr_.time().timeName(),
						obr_,
						IOobject::NO_READ,
						IOobject::AUTO_WRITE
					),
					U*s
				)
			);
			const volVectorField& flux1 = 
                        obr_.lookupObject<volVectorField>("flux1");
		#};
	}
Also the fieldAverage function to average the flux1 in time:
Code:
fieldAverage1
    {
      type                        fieldAverage;
      functionObjectLibs   ( "libfieldFunctionObjects.so" );
      resetOnRestart         true;
      resetOnOutput         false;
      startTime                75; 		
      endTime                 200; 		
      writeControl            adjustableRunTime;
      writeInterval           200;
      
      fields
      (
            flux1
           {
            mean              on;
            prime2Mean    on;
            base               time;	  
           }
      ); 
    }
hhu_lulu is offline   Reply With Quote

Reply

Tags
fluctuation, flux, les, openfoam, post-processing

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a transient .case file scro1022 EnSight 0 November 27, 2020 10:11
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 04:18
Issue symmetryPlane 2.5d extruded airfoil simulation 281419 OpenFOAM Running, Solving & CFD 5 November 28, 2015 13:09
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 17:27
zero flux boundary for diffusion scalar cmv Siemens 1 April 15, 2005 05:42


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