#NEWLINE# def test_natural_logarithm( self ) : #NEWLINE# #INDENT# self . phys [ 'pore.item1' ] = 1.6e-15 #NEWLINE# self . phys [ 'pore.item2' ] = 4 #NEWLINE# self . phys [ 'pore.item3' ] = 1.4 #NEWLINE# self . phys [ 'pore.item4' ] = 0.133 #NEWLINE# self . phys [ 'pore.item5' ] = ( - 5.1e-14 ) #NEWLINE# self . phys . models . add ( propname = 'pore.source1' , model = pm . generic_source_term . natural_logarithm , A1 = 'pore.item1' , A2 = 'pore.item2' , A3 = 'pore.item3' , A4 = 'pore.item4' , A5 = 'pore.item5' , x = 'mole_fraction' , return_rate = False , regen_mode = 'on_demand' ) #NEWLINE# self . phys . models . add ( propname = 'pore.source2' , model = pm . generic_source_term . natural_logarithm , A1 = 'pore.item1' , A2 = 'pore.item2' , A3 = 'pore.item3' , A4 = 'pore.item4' , A5 = 'pore.item5' , x = 'mole_fraction' , return_rate = True , regen_mode = 'on_demand' ) #NEWLINE# self . alg . set_source_term ( source_name = 'pore.source1' , pores = self . S_pores , mode = 'overwrite' ) #NEWLINE# self . alg . run ( conductance = 'throat.diffusive_conductance' , quantity = 'pore.mole_fraction' , super_pore_conductance = None ) #NEWLINE# self . alg . return_results ( ) #NEWLINE# self . phys . regenerate ( props = 'pore.source1' ) #NEWLINE# self . phys . regenerate ( props = 'pore.source2' ) #NEWLINE# X = self . phase [ 'pore.mole_fraction' ] #NEWLINE# r1 = np . round ( np . sum ( ( ( 1.6e-15 * np . log ( ( ( 4 * ( X [ self . S_pores ] ** 1.4 ) ) + 0.133 ) ) ) - 5.1e-14 ) ) , 20 ) #NEWLINE# r2 = np . round ( np . sum ( self . phys [ 'pore.source2' ] [ self . S_pores ] ) , 20 ) #NEWLINE# r3 = np . round ( self . alg . rate ( pores = self . S_pores ) [ 0 ] , 20 ) #NEWLINE# assert ( r1 == r2 ) #NEWLINE# assert ( r2 == ( - r3 ) )