Understanding of traps

Hi - just forgetting about hydrides for a moment, I’ve been trying to put in just standard traps. Am I correct in thinking that plotting the field ‘retention’ should show me the concentration of trapped hydrogen?

I have a 3mm long 1D set-up, and start off with 60 wt.ppm of H in one half. Without traps, this works, and over time I get 30wt.ppm across the whole system.

THen I try and put just 10 wt.ppm’s worth of traps in one half of my sample. The ‘retention’ field then shows 60 wt.ppm of H in the half with traps, and zero in the other half. Please could you advise?

(I’m also not sure whether the E_k for trapping and the E_p for detrapping should include the diffusion barrier of 0.1103 eV?

The relevant parts of my code are:

mat1 = F.Material(id=1, borders=(0, 1.5e-3), D_0=7e-5, E_D=0.1103, Q=lambda T: -0.0045 * F.k_B * T2)
mat2 = F.Material(id=2, borders=(1.5e-3, 3e-3), D_0=7e-5, E_D=0.1103, Q=lambda T: -0.0045 * F.k_B * T
2)

WTCONV = 3.894e24 #conversion of wt.ppm to atoms per m3
Zr_atom_density = 4.3e28 #Zr atoms per m3
DHYD = 7e-5*np.exp(-5364/(240+273)) #m-2 s-1
LPA = 3.23e-10 #m
print(DHYD) #m-2 s-1.
ATOMperM3 = 4.3e28 #atoms per m3.

Trap_1 = F.Trap(
k_0 = DHYD/(LPA2*(2*ATOMperM3)),
E_k=0.0,
p_0 = DHYD/LPA
2,
E_p = 0.5,
density = 10*WTCONV,
materials = mat1
)

Hi there Helen!

The ‘retention’ field shows the combined population of the mobile and all the trapped populations of hydrogen. It is possible to export the trap concentration by itself too if that is what you are after? This is done by exporting the field ‘n’ where n is the numerical order of the traps defined.

But regarding your issue would you be able to send a copy of the script you used but within 3x ` on either side, this will allow you to format the code like this:
example

Thankyou. (I thought I’d tried field “1” but I must have made some mistake somewhere.
I’ve re-tried the same programme but with a binding energy of 0.42 eV rather than 0.5 eV - the results all now make perfect sense: the trapping is just under 10 wt.ppm (for 0.5 eV I expect 10 wt.ppm trapped), and the mobile concentration plus the trapped concentration gives the retention concentration.
So I’m just not sure what goes wrong at 0.5 eV - I’ll play with the dt stepsize and see if that works. (PS I’m sorry, I’m not quite sure what you meant about sending the script with ‘’’ {script text} ‘’’ it didn’t seem to format any differently
Thankyou again for your help

Hi Helen,

As @jhdark mentioned, formatting your code makes it easier for us to assist you.
To format your code you need to use the backtick symbol (`) not the apostrophe ’

More information here: Posting code or preformatted text - Using Discourse - Discourse Meta

Hi James, for “This is done by exporting the field ‘n’ where n is the numerical order of the traps defined.”, can I ask that what does ‘the numerical order of the traps defined’ stand for? Does it mean that for example I have three different traps which the order is trap1, trap2 and trap3 in one material in my model, if I want to know the trap2’s concentration, should I use F.TotalVolume(field="2", volume=) for export?

Potentially yes. The number is based on the different species, so field=“0” will always be the mobile concentration, then the numbering of the fields for the traps follows the order in which they are defined in the list given to traps attribute of the Simulation class.

For instance, if you had

trap_alpha = F.Trap(...)
trap_beta = F.Trap(...)
trap_gamma = F.Trap(...)
my_model.traps = [trap_alpha, trap_beta, trap_gamma]

then trap_alpha would be field=“1”, trap_beta would be field=“2” and trap_gamma would be field=“3”.

2 Likes

When you create the Trap object, you can also give it an id that is then used in the field argument of the export.

1 Like

Thank you so much, James.

Thank you very much, Remi.

1 Like