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

How to modify psi value from the solver level (based on reactingFoam)?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 21, 2012, 14:05
Angry How to modify psi value from the solver level (based on reactingFoam)?
  #1
New Member
 
xinyu
Join Date: Apr 2010
Location: Connecticut
Posts: 9
Blog Entries: 1
Rep Power: 16
xinyu is on a distinguished road
Hello everyone,

I am writing a solver based on reactingFoam (1.7.1). The psi value is calculated from a user-routine, and I want to assign the value to psi and use that psi to update other thermo properties. However, in the basicThermo class, the psi is defined as const... I tried to add non-const access to psi, and there is no compilation error, but there is runtime error related to psi.oldtime(). Is there any way that I could update the psi value as well as alpha and mu from a solver level?

Thanks a lot,

Xinyu
xinyu is offline   Reply With Quote

Old   March 30, 2017, 23:33
Default
  #2
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13
wenxu is on a distinguished road
Yes, there is. First find the "psi" object using the "lookupObject" function, and use const_cast to convert it non-constant filed.

Best,
Xu
wenxu is offline   Reply With Quote

Reply

Tags
reactingfoam, thermo library


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
Pressure based and Density based Solver Xobile Main CFD Forum 39 August 19, 2020 06:04
Pressure Based Coupled Solver A.S. Main CFD Forum 1 November 8, 2015 09:59
adding radiation to reactingFoam solver Marshak OpenFOAM 1 February 13, 2012 05:43
Regarding Density based solver Eswar Main CFD Forum 2 June 6, 2007 11:00
Density based solver Eswar Main CFD Forum 2 May 29, 2007 07:29


All times are GMT -4. The time now is 15:10.