# Complex operations on scalar fields

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

 September 30, 2019, 05:42 [SOLVED] Complex operations on scalar fields #1 New Member   Join Date: Jul 2017 Posts: 10 Rep Power: 6 My case involves heat and mass transfer (of some alcohol in an air stream). I modified scalarTransportFoam to add mass transfer in the form of a new scalar field called "C". Now, I want to calculate, for every point in the mesh, the pressure of the vapor, the saturation pressure and ultimately the ratio of the two. These calculations involve exponential functions, with T and C as entry parameters. I could not find any scalar field operators to do that. I was wondering if the sample utility combined with some external code (C or Python) could help me do that ? Last edited by dplamp; October 22, 2019 at 07:38. Reason: mark thread solved

September 30, 2019, 08:32
#2
New Member

Josh
Join Date: Jun 2013
Posts: 19
Rep Power: 10
Quote:
 Originally Posted by dplamp My case involves heat and mass transfer (of some alcohol in an air stream). I modified scalarTransportFoam to add mass transfer in the form of a new scalar field called "C". Now, I want to calculate, for every point in the mesh, the pressure of the vapor, the saturation pressure and ultimately the ratio of the two. These calculations involve exponential functions, with T and C as entry parameters. I could not find any scalar field operators to do that. I was wondering if the sample utility combined with some external code (C or Python) could help me do that ?
You could write a filed function object which uses that new scalar field. Checkout src/functionObjects/field/ for some examples.

 October 22, 2019, 02:12 #3 New Member   Join Date: Jul 2017 Posts: 10 Rep Power: 6 Hi I found a solution that suits me better than function objects : the post processing sampling utility, to sample scalar fields on a plane. Then, I can easily manipulate the data and do whatever calculation and plots I want, in my case with Python. D. Last edited by dplamp; October 22, 2019 at 07:40. Reason: fix typo

 Tags post procesing, scalar field