Skip to content

Commit

Permalink
2 adims
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinAchondo committed Jul 8, 2024
1 parent 908687f commit 71745ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion tests/test_xppbe.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def test_scripts():
('DCM','nonlinear','regularized_scheme_2'),
('DVM','linear','direct'),
('DVM','linear','regularized_scheme_1'),
('DVM','nonlinear','regularized_scheme_1'),
('DBM','linear','direct')
)
)
Expand Down
14 changes: 8 additions & 6 deletions xppbe/Model/PDE_Model.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ def calculate_properties(self,domain_properties):

domain_properties['concentration'] = (kappa/self.ang_to_m)**2*(self.eps0*epsilon_2*self.kb*T)/(2*self.qe**2*self.Na)/1000

qe_eps0_ang = qe/(eps0 * ang_to_m)
fact = kb/(qe_eps0_ang*qe)
if self.adim == 'qe_eps0_angs':
self.to_V = self.qe/(self.eps0 * self.ang_to_m)
domain_properties['beta'] = 1
domain_properties['gamma'] = T*self.kb*self.eps0*self.ang_to_m/self.qe**2
elif self.adim == 'kbT_qe':
domain_properties['gamma'] = T*fact
elif self.adim == 'kb_T_qe':
self.to_V = self.kb*self.T/self.qe
domain_properties['beta'] = T*self.kb*self.eps0*self.ang_to_m/self.qe**2
domain_properties['beta'] = T*fact
domain_properties['gamma'] = 1

for key in ['molecule','epsilon_1','epsilon_2','kappa','T','concentration','beta','gamma']:
Expand Down Expand Up @@ -113,9 +115,9 @@ def get_phi_ens(self,model,X_mesh,q_L, method='mean', pinn=True, known_method=Fa
else:
phi = self.phi_known(known_method,'phi',tf.constant(X_solv),'solvent').reshape(-1,1)
r_H = tf.math.sqrt(tf.reduce_sum(tf.square(x_q - X_solv), axis=1, keepdims=True))
G2_p = tf.math.reduce_sum(self.aprox_exp(-phi/self.T_adim)/r_H**6)
G2_m = tf.math.reduce_sum(self.aprox_exp(phi/self.T_adim)/r_H**6)
phi_ens_pred = - self.T_adim/2 * tf.math.log(G2_p/G2_m)
G2_p = tf.math.reduce_sum(self.aprox_exp(-phi/self.gamma)/r_H**6)
G2_m = tf.math.reduce_sum(self.aprox_exp(phi/self.gamma)/r_H**6)
phi_ens_pred = - self.gamma/2 * tf.math.log(G2_p/G2_m)

elif method=='mean':
r_H = tf.math.sqrt(tf.reduce_sum(tf.square(x_q - X_solv), axis=1))
Expand Down

0 comments on commit 71745ac

Please sign in to comment.