Output turbulent scalar fluxes

176 views
Skip to first unread message

Pau Fradera

unread,
Dec 6, 2024, 2:44:33 PM12/6/24
to Nek5000
Dear community,

I am currently using avg_all() to get the turbulence statistics. However, I would also need to get the turbulent scalar fluxes fields (for 9 different scalars present in my simulation). I would like to ask for help or guidance on how I could achieve this.

Thanks a lot in advance.

Sincerely,

Pau

X. G. Zhou

unread,
Dec 6, 2024, 9:44:04 PM12/6/24
to Nek5000
Dear Pau. 

I am a new comer in Nek5000. However, I would like to discuss this post. 

If you need to obtain the turbulent scalar (or heat) fluxes, i would like to recommed the subroutine userchk in tutorial case of 'turbChannel'. 

The subroutine userchk in 'turbChannel' provides us with an excellent example code for Nek5000 to obtain standard flow and heat (or scalar) transfer statistics, such as Reynolds stress, mean velocity and temperature, turbulent heat (or scalar) fluxes in a channel. 

That is to say, we can try to write some code sections on the existing basis of subroutine userchk in 'turbChannel' to meet our needs. 

It is worthynoting that the original code of subroutine userchk in 'turbChannel' might have a little bug when calculating the streamwise turbulent heat (or scalar) flux for passive scalar transport in a channel . An attempt to get the correct results can see in this post: A little bug in the tutorial case "turbChannel"

When modifying the code to obtain the statistics, we need to clarify the method of time-averaging operation in Nek5000, which can be referred to page 'Averaging' at Additional Features — Nek5000 documentation

In summary, i would recommend to make the following operations
(1) Read carefully the time-averaging operation in Nek5000 at Additional Features — Nek5000 documentation
(2) Run the tutorial case 'turbChannel'
(3) Read the subroutine 'userchk' in 'turbChannel.usr' file
(4) Try to modify the subroutine 'userchk' to get the statistics which we want.
(5) Use a coarse mesh to validate a benchmark case to check the modfication by ourselves is correct. 

Besides, maybe the KTH toolbox is also a good choice to get more statistics, such as budgets of turbulent kinetic energy equation. 

I hope this post would help you to some extent. 

Best,

Student, Xingguang Zhou
Xi'an Jiaotong Univ.

Pau Fradera

unread,
Mar 20, 2025, 2:46:42 PMMar 20
to Nek5000
Hi Xingguang Zhou,

Thanks for your reply! I will try to see if I can figure it out that way.

Thanks.

Best,

Pau

El dia divendres, 6 de desembre del 2024 a les 18:44:04 UTC-8, X. G. Zhou va escriure:

Pau Fradera

unread,
Jul 22, 2025, 5:06:13 PMJul 22
to Nek5000
Dear Nek community,

I have performed a slight modification into the original avg_all() subroutine, in order to be able to obtain the velocity-scalar covariances to obtain turbulent scalar fluxes (<u'c'>, <v'c'>, <w'c'>) among my outputted statistics.

I conducted the following modification to the avg_all() routine, in this case for the scalar number 5:

modified_avg_all.png


I checked the results this produces and they seem reasonable, but I am not fully sure if this modification I did to the original avg_all() routine is correct or if I may be making a huge mistake that I am not aware of.

Also, I was wondering if, due to the way ntot is defined in avg_all(), this modification I made maybe is only valid for PnPn formulation, but not for PnPn-2? Is my understanding correct?

Thank you very much in advance for your help.

Sincerely yours,

Pau


El dia dijous, 20 de març del 2025 a les 11:46:42 UTC-7, Pau Fradera va escriure:
Reply all
Reply to author
Forward
0 new messages