Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing #60

Open
wants to merge 6 commits into
base: development
Choose a base branch
from

Conversation

jackieyao0114
Copy link
Collaborator

@jackieyao0114 jackieyao0114 commented Dec 29, 2024

This PR implemented the parsing function of material properties, including all the Landau energy coefficients, gradient energy coefficients, and relative permittivities.

BigGamma,
alpha, 
beta,   
gamma,  
epsilonX_fe,
epsilonZ_fe,
epsilon_de, 
epsilon_si, 
g11,   
g44,  
g44_p, 
g12, 
alpha_12, 
alpha_112, 
alpha_123

Note the tetragonal phase epsilon is not included, i.e., it is still a constant input independent of location.

This is also based on the nucleation setup --- some percentage of the FE material is pinned at the remnant polarization.

The demonstration is performed without the nucleation function. In main.cpp, the two incidences of SetNucleation(P_old, MaterialMask, n_cell); are commented out. Using the following input files for both this branch and the upstream/development branch, running the simulation, and use the Amrex utility amrex/Tools/Plotfile/fcompare.cpp to compare the generated plot files, we get the following difference between the two simulations:

Input file:

#################################
###### PROBLEM DOMAIN ######
#################################
amrex.the_arena_is_managed = 1

domain.prob_lo = -64.e-8 -4.e-8  0.0e-8
domain.prob_hi =  64.e-8  4.e-8  6.0e-8

domain.n_cell = 1024 64 64

domain.max_grid_size = 64 64 64
domain.blocking_factor = 64 64 64

prob_type = 1

TimeIntegratorOrder = 1

nsteps = 1000000
# plot_int = 10000
plot_int = 10
Remnant_P = 0.0 0.0 0.26
noise_amplitude = 0.001

dt = 10.0e-8

############################################
###### POLARIZATION BOUNDARY CONDITIONS ####
############################################

P_BC_flag_lo = 3 3 1 # dP/dz= P_lo/lambda;
P_BC_flag_hi = 3 3 1 # dP/dz= P_hi/lambda;
lambda = 5.e-9

############################################
###### ELECTRICAL BOUNDARY CONDITIONS ######
############################################

domain.is_periodic = 1 1 0

boundary.hi = per per dir(0.3)
boundary.lo = per per dir(0.0)

voltage_sweep = 1
Phi_Bc_lo = 0.0
Phi_Bc_hi = 0.3

Phi_Bc_inc = -0.03
Phi_Bc_hi_max = 0.3
phi_tolerance = 1.e-6
num_Vapp_max = 41 #121
theta_dep = 0.80

use_Fermi_Dirac = 1
use_work_function = 0 #1
#################################
###### STACK GEOMETRY ###########
#################################

#unused 
SC_lo = -1.0 -1.0 -1.0
SC_hi = -1.0 -1.0 -1.0

DE_lo = -64.0e-8 -4.0e-8 0.0
DE_hi =  64.0e-8  4.0e-8 5.0e-9

DE1_lo = -64.0e-8 -4.0e-8 55.0e-9
DE1_hi =  64.0e-8  4.0e-8 60.0e-9

FE_lo = -64.e-8 -4.e-8 5.0e-9
FE_hi =  64.e-8  4.e-8 55.0e-9

#################################
###### MATERIAL PROPERTIES ######
#################################

# upstream/development
epsilon_0 = 8.85e-12
# epsilonX_fe = 600.0
# epsilonZ_fe = 600.0
# epsilon_de = 300.0
# epsilon_si = 80.0
# # -13860999.999999998 -1618875000.0 32016000000.0 0
# #-7423200.0 -209700000.0 7764000000.0 0 --> Ec=15 kV/cm
# #-18558000.0 -209700000.0 10352000000.0 0 --> Ec=30kV/cm
# alpha = -18558000.0 #-3.7116e7 #-1.386e7 #-7.588e7 # 3.34*(T-381)*1e5*2; T=298; ref: Rabe book
# beta = -209700000.0 #-2.097e8 #-1.618875e9 #-8.388e8 #-2.5902e9 # (4.69*(T-393)-202)*1e6*4
# gamma = 10352000000.0 #1.0352e10 #3.2e10 #7.764e9 # 4.8024e10 # (-5.52*(298-393) + 276)*1e7*6
# BigGamma = 1.e-3
# g11 = 20.e-11 # zz
# g44 = 1.e-11
# g44_p = 0.0
# g12 = 0.0
# alpha_12 = 0.0
# alpha_112 = 0.0
# alpha_123 = 0.0

# this branch
material_properties.BigGamma_function(x,y,z) = 1.e-3 * (z<=55.e-9 ) * ( z >= 5.e-9)
material_properties.landau_alpha_function(x,y,z) = -18558000.0 * (z<=55.e-9 ) * ( z >= 5.e-9)
material_properties.landau_beta_function(x,y,z) = -209700000.0 * (z<=55.e-9 ) * ( z >= 5.e-9)
material_properties.landau_gamma_function(x,y,z) = 10352000000.0 * (z<=55.e-9 ) * ( z >= 5.e-9)
material_properties.g11_function(x,y,z) = 20.e-11 * (z<=55.e-9 ) * ( z >= 5.e-9)
material_properties.g44_function(x,y,z) = 1.e-11 * (z<=55.e-9 ) * ( z >= 5.e-9)
material_properties.g44_p_function(x,y,z) = 0.0 * (z<=55.e-9 ) * ( z >= 5.e-9)
material_properties.g12_function(x,y,z) = 0.0
material_properties.alpha_12_function(x,y,z) = 0.0
material_properties.alpha_112_function(x,y,z) = 0.0
material_properties.alpha_123_function(x,y,z) = 0.0

material_properties.epsilonX_fe_function(x,y,z) = 600.0 * (z<=55.e-9 ) * ( z >= 5.e-9) + 1.0
material_properties.epsilonZ_fe_function(x,y,z) = 600.0 * (z<=55.e-9 ) * ( z >= 5.e-9) + 1.0
material_properties.epsilon_de_function(x,y,z) = 300.0 * (z>55.e-9) + 300.0 * (z<5.e-9) + 1.0
material_properties.epsilon_si_function(x,y,z) = 80.0


donor_doping = 0.25e28
acceptor_doping = 0.1e28

At 800th time step,

WARNING: number of variables do not match
 WARNING: variable BigGamma not found in plotfile 2
 WARNING: variable gamma not found in plotfile 2
 WARNING: variable epsilonX_fe not found in plotfile 2
 WARNING: variable epsilonZ_fe not found in plotfile 2
 WARNING: variable epsilon_de not found in plotfile 2
 WARNING: variable epsilon_si not found in plotfile 2
 WARNING: variable g11 not found in plotfile 2
 WARNING: variable g44 not found in plotfile 2
 WARNING: variable g44_p not found in plotfile 2
 WARNING: variable g12 not found in plotfile 2
 WARNING: variable alpha_12 not found in plotfile 2
 WARNING: variable alpha_112 not found in plotfile 2
 WARNING: variable alpha_123 not found in plotfile 2
 WARNING: variable angle_alpha not found in plotfile 2
 WARNING: variable angle_beta not found in plotfile 2
 WARNING: variable angle_theta not found in plotfile 2
 WARNING: variable theta not found in plotfile 1

            variable name            absolute error            relative error
                                        (||A - B||)         (||A - B||/||A||)
 ----------------------------------------------------------------------------
 level = 0
 Px                                               0                         0
 Py                                               0                         0
 Pz                                 6.851132389e-05           0.0002728196248
 Phi                                0.0001447901247           0.0004969654544
 PoissonRHS                             12295.64556           0.0004207526407
 Ex                                     231.2898436             0.01005436314
 Ey                                   1.7985613e-05             0.04210635754
 Ez                                     54208.30658            0.001761639868
 holes                                            0                         0
 electrons                                        0                         0
 charge                                           0                         0
 epsilon                                   8.85e-12            0.001663893511
 mask                                             0                         0
 tphase                                           0                         0
 BigGamma                  < variable not present in both files >            
 alpha                                     18558000                         1
 beta                                     209700000                         1
 gamma                     < variable not present in both files >            
 epsilonX_fe               < variable not present in both files >            
 epsilonZ_fe               < variable not present in both files >            
 epsilon_de                < variable not present in both files >            
 epsilon_si                < variable not present in both files >            
 g11                       < variable not present in both files >            
 g44                       < variable not present in both files >            
 g44_p                     < variable not present in both files >            
 g12                       < variable not present in both files >            
 alpha_12                  < variable not present in both files >            
 alpha_112                 < variable not present in both files >            
 alpha_123                 < variable not present in both files >            
 angle_alpha               < variable not present in both files >            
 angle_beta                < variable not present in both files >            
 angle_theta               < variable not present in both files >            
 PhiDiff                            5.556216533e-08            0.009465263026
 WARNING: not all variables present in both files

At 1600th time step:

WARNING: number of variables do not match
 WARNING: variable BigGamma not found in plotfile 2
 WARNING: variable gamma not found in plotfile 2
 WARNING: variable epsilonX_fe not found in plotfile 2
 WARNING: variable epsilonZ_fe not found in plotfile 2
 WARNING: variable epsilon_de not found in plotfile 2
 WARNING: variable epsilon_si not found in plotfile 2
 WARNING: variable g11 not found in plotfile 2
 WARNING: variable g44 not found in plotfile 2
 WARNING: variable g44_p not found in plotfile 2
 WARNING: variable g12 not found in plotfile 2
 WARNING: variable alpha_12 not found in plotfile 2
 WARNING: variable alpha_112 not found in plotfile 2
 WARNING: variable alpha_123 not found in plotfile 2
 WARNING: variable angle_alpha not found in plotfile 2
 WARNING: variable angle_beta not found in plotfile 2
 WARNING: variable angle_theta not found in plotfile 2
 WARNING: variable theta not found in plotfile 1

            variable name            absolute error            relative error
                                        (||A - B||)         (||A - B||/||A||)
 ----------------------------------------------------------------------------
 level = 0
 Px                                               0                         0
 Py                                               0                         0
 Pz                                 5.033053772e-05           0.0002101401535
 Phi                                0.0001289610262           0.0007453574203
 PoissonRHS                             11884.44412           0.0004217702249
 Ex                                  0.002802758026             0.01450847144
 Ey                                 1.076916334e-05             0.04205141544
 Ez                                     47924.38887            0.001930785517
 holes                                            0                         0
 electrons                                        0                         0
 charge                                           0                         0
 epsilon                                   8.85e-12            0.001663893511
 mask                                             0                         0
 tphase                                           0                         0
 BigGamma                  < variable not present in both files >            
 alpha                                     18558000                         1
 beta                                     209700000                         1
 gamma                     < variable not present in both files >            
 epsilonX_fe               < variable not present in both files >            
 epsilonZ_fe               < variable not present in both files >            
 epsilon_de                < variable not present in both files >            
 epsilon_si                < variable not present in both files >            
 g11                       < variable not present in both files >            
 g44                       < variable not present in both files >            
 g44_p                     < variable not present in both files >            
 g12                       < variable not present in both files >            
 alpha_12                  < variable not present in both files >            
 alpha_112                 < variable not present in both files >            
 alpha_123                 < variable not present in both files >            
 angle_alpha               < variable not present in both files >            
 angle_beta                < variable not present in both files >            
 angle_theta               < variable not present in both files >            
 PhiDiff                            2.020813543e-07             0.02037471458
 WARNING: not all variables present in both files

@jackieyao0114 jackieyao0114 marked this pull request as ready for review January 11, 2025 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants