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

Non interger scalar field power - Chemistry law

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 26, 2014, 15:17
Default Non interger scalar field power - Chemistry law
  #1
New Member
 
Join Date: Apr 2013
Posts: 20
Rep Power: 13
Nathanael3 is on a distinguished road
Hi Foamers,

I would like to code a chemistry problem. A field named C is consumed over time following random chemistry law:

\frac{dC}{dt} = k C^{0.41}

The problem is that the exponent is not an integer.
In the case where the chemistry is:

\frac{dC}{dt} = k' C

I use the following code:

Quote:
solve
(
fvm::ddt(C)
==
fvm::Sp(k, C)
);
It is really convenient because I solve it implicitly.

Would it be possible to do the same with the "0.41 exponent" ?

Thanks,
Nathanael.
Nathanael3 is offline   Reply With Quote

Old   June 29, 2014, 04:39
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
nope its not possible, you should make it linear forexample some thing like this:
Code:
solve
                        (
                                    fvm::ddt(C)    
                    ==        
                                    fvm::Sp(k/pow(C,0.51), C)
                        );
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   June 29, 2014, 11:56
Default
  #3
New Member
 
Join Date: Apr 2013
Posts: 20
Rep Power: 13
Nathanael3 is on a distinguished road
Hi nimasam,

Thank you for your answer. I was affraid that it would not be possible.

The problem with the suggested code is that it crashes if C = 0 somewhere in the scalarfield.

Thanks for your help,
Nathanaël.
Nathanael3 is offline   Reply With Quote

Old   June 29, 2014, 14:12
Default
  #4
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
you can add a very small number forexample:
Quote:
1/(pow(c,0.51)+1e-08)
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Reply

Tags
chemistry


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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
One-Seventh power law in turbulent pipe flows selvam2487 CFX 3 September 9, 2013 18:46
UDF power law dimsum Fluent UDF and Scheme Programming 0 June 4, 2013 03:26
Star CCM+ issue (VOF and Non newtonian power law) Sam Siemens 3 January 23, 2009 08:39
from a vecor field to get a gradient of scalar dusky.he Main CFD Forum 4 March 30, 2007 10:08


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