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

Complex operations on scalar fields

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 30, 2019, 05:42
Default [SOLVED] Complex operations on scalar fields
  #1
New Member
 
Join Date: Jul 2017
Posts: 10
Rep Power: 8
dplamp is on a distinguished road
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
dplamp is offline   Reply With Quote

Old   September 30, 2019, 08:32
Default
  #2
New Member
 
Josh
Join Date: Jun 2013
Posts: 19
Rep Power: 12
joshm is on a distinguished road
Quote:
Originally Posted by dplamp View Post
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.
joshm is offline   Reply With Quote

Old   October 22, 2019, 02:12
Default
  #3
New Member
 
Join Date: Jul 2017
Posts: 10
Rep Power: 8
dplamp is on a distinguished road
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
dplamp is offline   Reply With Quote

Reply

Tags
post procesing, scalar field


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
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 13 March 24, 2021 07:15
Temperature calculation from total enthalpy in OpenFOAM (XiFOAM) sharifi OpenFOAM Running, Solving & CFD 1 October 8, 2020 09:16
Complex geometric fields Ali Blues OpenFOAM Programming & Development 1 January 1, 2018 17:51
Problem with complex eigenvalues detected for symmTensor tbao OpenFOAM 3 November 3, 2016 09:24
is internalField(U) equivalent to zeroGradient? immortality OpenFOAM Running, Solving & CFD 7 March 29, 2013 01:27


All times are GMT -4. The time now is 07:39.