-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_helium3.py
2122 lines (1572 loc) · 94.3 KB
/
mod_helium3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
"""
Created on Sat June 03 2017
library should take in arguments as float, list, numpy arrays or Pandas
@author: Tsepelin V
"""
import numpy as np
#import mod_oscillator as osc
#import mod_stokes as stokes
#import mod_fileio as fio
from scipy.special import erfc
##############################################################################
### Constants
##############################################################################
Boltzmann_const = 1.38064852e-23 #[J/K]
Plank_const = 6.626176e-34
Plankbar_const = Plank_const / (2.0 * np.pi)
Avogadro_const = 6.022140857e+23
ElectronV = 1.6021766208e-19 #[C]
atomic_mass_unit = 1.660539040e-27 #[kg]
molar_mass = 3.0160293e-3 #[kg]
atomic_mass = 3.0160293 * atomic_mass_unit
kappa = Plank_const /(2 * molar_mass / Avogadro_const)
gap_coeff = 1.76 # BCS theory energy gap value
#coefficients used in "mod_stokes" for vibrating wire thermometry
meanfreepath_adjustment = 1.9
ballistic_switch = 1.0
#superfluid coefficents for thermometry abd BBR calibration
gamma_coefficient = 0.28 # PRB 57 (1998) 14381, Bauerle et.al. Grenoble + Lancaster
yoshida_scaledT_poly = [-0.0611, 0.1396, - 0.0216, -0.0075, 0.9074]
##############################################################################
### Normal liquid parameters
##############################################################################
def molarvolume(PressureBar):
"""For a given pressure [bar] function returns the helium-3 molar volume [m^3 per mol].
based on Greywall
; http://dx.doi.org/
''
"""
molarvolume_poly = [-0.91253577e-6, 0.94759780e-4, -0.38859562e-2, 0.83421417e-1, -0.11803474e1, 36.837231]
# change float into numpy array for function len() to work
try:
len(PressureBar)
except:
PressureBar = np.array([PressureBar])
return 1.0e-6 * np.polyval(molarvolume_poly, PressureBar)
def he3_density(PressureBar):
"""For a given pressure[bar] function returns the helium-3 density [kg m^3].
based on Greywall
; http://dx.doi.org/
''
"""
# change float into numpy array for function len() to work
try:
len(PressureBar)
except:
PressureBar = np.array([PressureBar])
return molar_mass / molarvolume(PressureBar)
def density_SVP(TemperatureK):
"""For a given temperature[K] function returns the helium-3 density at SVP [kg m^3].
based on Willks?
; http://dx.doi.org/
''
"""
density_poly = [0.0604, - 0.1175, 0.8375, - 0.7880, 36.9087]
# change float into numpy array for function len() to work
try:
len(TemperatureK)
except:
TemperatureK = np.array([TemperatureK])
rho = 1.0e6* molar_mass / np.polyval(density_poly, TemperatureK)
return rho
def sound_velocity_first(TemperatureK):
"""
Calculates the first sound velocity of helium-3 for a given temperature
:param TemperatureK: The temperature in Kelvin
:return: The first sound velocity in m/s
based on Laquer H.L. et al., Phys. Rev. 113, 417 (1959)
"""
first_sound_poly = [-0.00176, 0.0, 0.0, 0.0, 0.0, -0.130, -5.98, 0.0, 183.9]
try:
len(TemperatureK)
except TypeError as e:
TemperatureK = np.array([TemperatureK])
first_sound = np.zeros(len(TemperatureK))
for temp_index in range(len(TemperatureK)):
first_sound[temp_index] = np.polyval(first_sound_poly, TemperatureK)
return first_sound
def heatcapacity_gamma(PressureBar):
"""For a given pressure[bar] function returns the value of heat capacity gamma .
based on Greywall
; http://dx.doi.org/
''
"""
gamma_poly = [-0.53785385e-6,0.46153498e-4,-0.14738303e-2,0.69575243e-1,2.7840464]
# change float into numpy array for function len() to work
try:
len(PressureBar)
except:
PressureBar = np.array([PressureBar])
return np.polyval(gamma_poly, PressureBar)
def mass_effective(PressureBar):
"""For a given pressure[bar] function returns the value of effective mass.
based on Greywall
; http://dx.doi.org/
''
"""
# change float into numpy array for function len() to work
try:
len(PressureBar)
except:
PressureBar = np.array([PressureBar])
return 3.06413e-27 * 1.0e-2 * heatcapacity_gamma(PressureBar) / (molarvolume(PressureBar) * Fermi_momentum(PressureBar))
def mass_effective_polynomial(PressureBar):
"""For a given pressure[bar] function returns the value of effective mass.
based on Greywall
; http://dx.doi.org/
''
"""
masseff_poly = [ 1.75334e-8, -2.4401e-6, 1.33671e-4, -0.00366, 0.13133, 2.79972]
# change float into numpy array for function len() to work
try:
len(PressureBar)
except:
PressureBar = np.array([PressureBar])
return np.polyval(masseff_poly, PressureBar)
def viscosity(TemperatureK, PressureBar = 0.0):
"""For a given pressure[Bar] and temperature[K] array returns the helium-3 viscosity [Pa s].
Function is valid between 5?mK and 17 mK
based on D. C. Carless,t H. E. Hall, and J. R. Hook
Journal of Low Temperature Physics 50, 584 (1983); http://dx.doi.org/
'Vibrating Wire Measurements in Liquid 3He. I. The Normal State'
1.0e-1 / (coeff_A*(1.0e3*TemperatureK)**2 + coeff_B)
"""
if PressureBar < 1.28:
tempA = 0.38 - 0.007 * (1.28 - PressureBar) / 1.18
tempB = 0.06 - 0.02 * (1.28 - PressureBar) / 1.18
elif PressureBar < 4.65:
tempA = 0.424 - 0.044 * (4.65 - PressureBar) / 3.37
tempB = 0.19 - 0.13 * (4.65 - PressureBar) / 3.37
elif PressureBar < 9.89:
tempA = 0.495 - 0.071 * (9.89 - PressureBar) / 5.24
tempB = 0.43 - 0.24 * (9.89 - PressureBar) / 5.24
elif PressureBar < 19.89:
tempA = 0.603 - 0.108 * (19.89 - PressureBar) / 10
tempB = 0.94 - 0.56 * (19.89 - PressureBar) / 10
else:
tempA = 0.603 + 0.107 * (PressureBar - 19.89) / 9.45
tempB = 0.94 + 0.56 * (PressureBar - 19.89) / 9.45
coeffA = tempA * 10 * 1.12e3 * 1.12e3
coeffB = tempB * 10
# change float into numpy array for function len() to work
try:
len(TemperatureK)
except:
TemperatureK = np.array([TemperatureK])
return 1.0 / (coeffA * TemperatureK**2 + coeffB) # Pa s
def viscosity_SVP(TemperatureK):
"""For a given temperature[K] array returns the helium-3 viscosity at SVP[Pa s].
Function is valid between ~6mK and 1.8K
based on D.I. Bradley et al.
J Low Temp Phys 171, 750 (2013) ; http://dx.doi.org/10.1007/s10909-012-0804-3
'Thermometry in Normal Liquid 3He Using a Quartz Tuning Fork Viscometer'
"""
viscosity_poly = [-6.92457,22.39929,-24.7364,28.22503,4.73534,2.02717]
# change float into numpy array for function len() to work
try:
len(TemperatureK)
except:
TemperatureK = np.array([TemperatureK])
return 1.0e-7 * np.polyval(viscosity_poly,TemperatureK) / np.power(TemperatureK, 2.0) # Pa s
def viscosity_SVP_BHT(TemperatureK):
"""For a given temperature[K] array returns the helium-3 viscosity [Pa s] at SVP.
Function is valid between 50mK and 3.0K
based on M. A. BLACK, H. E. HALL and K. THOMPSON
J. Phys. C: Solid St. Phys., 4, 129 (1971); http://dx.doi.org/
'The viscosity of liquid helium 3'
"""
# change float into numpy array for function len() to work
try:
len(TemperatureK)
except:
TemperatureK = np.array([TemperatureK])
return 1.0e-7 * (2.21 / TemperatureK**2 + 26.3 / TemperatureK**(1/3) ) # Pa s
def viscosity_SVP_CHH(TemperatureK):
"""For a given temperature[K] array returns the helium-3 viscosity [Pa s] at SVP.
Function is valid between 5?mK and 17 mK
based on D. C. Carless,t H. E. Hall, and J. R. Hook
Journal of Low Temperature Physics 50, 584 (1983); http://dx.doi.org/
'Vibrating Wire Measurements in Liquid 3He. I. The Normal State'
"""
# change float into numpy array for function len() to work
try:
len(TemperatureK)
except:
TemperatureK = np.array([TemperatureK])
return 1.0e-1 / (0.468*(1.0e3*TemperatureK)**2 + 0.0383) # Pa s
def viscosity_Tony(TemperatureK):
if type(TemperatureK) == float:
TemperatureK = np.array([TemperatureK])
eta = []
for temp in TemperatureK.tolist():
e = 0.277e-7 / temp**2 + 3.4e-7 / temp
if temp < 0.0165:
e = 0.305e-7 / temp**2 + 1.35e-7 / temp + 2.2e-6
if temp > 0.068:
e = 0.29e-7 / temp**2 + 1.65e-7 / temp + 2.3e-6
eta.append(e)
return np.array(eta)
def viscosity_over_meanfreepath(PressureBar):
"""For a given temperature[K] and Concentration returns the He3-He4 mixture mean free path [???].
Function is valid between ~?mK and ?K
based on D.I. Bradley et al.
"""
return 0.2 * (Avogadro_const/molarvolume(PressureBar)) ** (4.0/3.0) * (3.0*9.8696) ** (1.0/3.0) * Plankbar_const
def normalfluid_sliplength(TemperatureK, PressureBar):
"""
For a given temperatre [k] and pressure [bar] returns the slip length of He-3.
Equation from Dieter Vollhardt, Peter Wolfle "The Superfluid Phases of Helium-3" pp 483
slip length = 0.579 * mean free path
:param TemperatureK: Temperature in Kelvin
:param PressureBar: Pressure in Bar
:return: The slip length in meters
"""
return 0.579 * meanfreepath(TemperatureK, PressureBar)
def meanfreepath(TemperatureK, PressureBar):
"""For a given temperature[K] and Concentration returns the He3-He4 mixture mean free path [???].
Function is valid between ~?mK and ?K
based on D.I. Bradley et al.
"""
return viscosity(TemperatureK, PressureBar) / viscosity_over_meanfreepath(PressureBar)
def meanfreepath_SVP(TemperatureK, PressureBar = 0.0):
"""For a given temperature[K] and Concentration returns the He3-He4 mixture mean free path [???].
Function is valid between ~?mK and ?K
based on D.I. Bradley et al.
"""
return viscosity_SVP(TemperatureK) / viscosity_over_meanfreepath(PressureBar)
def Fermi_momentum(PressureBar):
"""For a given pressure[bar] function returns the Fermi momentum of helium-3 [kg m s-1].
based on Greywall
; http://dx.doi.org/
''
"""
# change float into numpy array for function len() to work
try:
len(PressureBar)
except:
PressureBar = np.array([PressureBar])
return 2.7551e-26 * molarvolume(PressureBar)**(-1.0/3.0)
def Fermi_velocity(PressureBar):
"""For a given pressure[bar] function returns the Fermi velocity of helium-3 [m s-1].
based on Greywall
; http://dx.doi.org/
''
"""
# change float into numpy array for function len() to work
try:
len(PressureBar)
except:
PressureBar = np.array([PressureBar])
return Fermi_momentum(PressureBar) / (mass_effective(PressureBar) * atomic_mass)
def Fermi_parameterF1(PressureBar):
"""For a given pressure[bar] function returns the value of F1 Fermi parameter.
based on Greywall
; http://dx.doi.org/
''
"""
# change float into numpy array for function len() to work
try:
len(PressureBar)
except:
PressureBar = np.array([PressureBar])
return 3.0 * (mass_effective(PressureBar) - 1)
def density_of_states(PressureBar):
"""For a given pressure[Bar] returns the density of states at Fermi energy
Function is valid between 0 and 35bars
based on Enns Eq.(3.28) chapter on Landau Fermi Theory
"""
return 2.0**3 * np.pi * atomic_mass * mass_effective(PressureBar) * Fermi_momentum(PressureBar) / Plank_const ** 3.0
def K0(PressureBar):
"""For a given pressure[Bar] returns the K0[???].
Function is valid between 0 and 35bars
based on D.I. Bradley et al.
"""
return 8.32 / 3.0 * heatcapacity_gamma(PressureBar) * Fermi_velocity(PressureBar) / molarvolume(PressureBar)
def Kcorr(PressureBar):
"""For a given pressure[Bar] returns the Kcorr[???].
Function is valid between 0 and 35bars
based on D.I. Bradley et al.
"""
return np.pi * 0.95e-3**2.0 * Boltzmann_const**2.0 / 2.0 * density_of_states(PressureBar)* Fermi_velocity(PressureBar)
def viscous_penetration_depth(FrequencyHz, TemperatureK, PressureBar):
"""
- Calculates the viscous penetration depth for a given oscillator with frequency(Hz) in He3 fluid.
-
- Uses delta = sqrt(eta/(density_nf * pi * omega)
-
- FrequencyHz: frequency of oscillator
- TemperatureK: temperature of helium mixture at SVP
- """
deltaM = osc.viscous_penetration_depth(2.0 * FrequencyHz, viscosity(TemperatureK, PressureBar), density(PressureBar))
#double frequency is used to be consistent with an old library
return deltaM
def viscous_penetration_depth_SVP(FrequencyHz, TemperatureK):
"""
- Calculates the viscous penetration depth for a given oscillator with frequency(Hz) in He3He4 mixture.
-
- Uses delta = sqrt(eta/(density_nf * pi * omega)
-
- FrequencyHz: frequency of oscillator
- TemperatureK: temperature of helium mixture at SVP
- """
deltaM = osc.viscous_penetration_depth(2.0 * FrequencyHz, viscosity_SVP(TemperatureK), density_SVP(TemperatureK))
#double frequency is used to be consistent with an old library
return deltaM
def __get_charatersictic_size(ObjOscillator):
if type(ObjOscillator) == osc.vibrating_loop:
length = ObjOscillator._diameter
elif type(ObjOscillator) == osc.tuning_fork:
length = ObjOscillator.width()
else:
raise NotImplementedError('Object oscillator "%s" has no implemented characteristic size' %
ObjOscillator.name())
return length / ObjOscillator.get_stokes_parameter()
def resonance_frequency_shift_obj(ObjOscillator, TemperatureK, PressureBar):
"""
- Calculates frequency shift of an oscillator in normal He3 for a given oscillator.
-
- Made from the old fortran code by Bradley, parameters are tuned for the Vibrating wires
-
- ObjOscillator: Oscillator object (wire or tuning fork) from mod_oscillator
- TemperatureK: temperature of helium mixture at SVP, the module will not work correctly above ~100mK
- """
osc_radius = __get_charatersictic_size(ObjOscillator)
osc_frequency = ObjOscillator.frequency_vacuum
osc_density = ObjOscillator.density()
res_shift = stokes.resonance_frequency_shift(osc_frequency, osc_radius, osc_density,
viscous_penetration_depth(osc_frequency, TemperatureK, PressureBar),
meanfreepath(TemperatureK, PressureBar),
density(PressureBar), meanfreepath_adjustment, ballistic_switch)
return res_shift
def resonance_frequency_shift_obj_SVP(ObjOscillator, TemperatureK, PressureBar = 0.0):
"""
- Calculates frequency shift of an oscillator in normal He3 for a given oscillator.
-
- Made from the old fortran code by Bradley, parameters are tuned for the Vibrating wires
-
- ObjOscillator: Oscillator object (wire or tuning fork) from mod_oscillator
- TemperatureK: temperature of helium mixture at SVP, the module will not work correctly above ~100mK
- """
osc_radius = __get_charatersictic_size(ObjOscillator)
osc_frequency = ObjOscillator.frequency_vacuum
osc_density = ObjOscillator.density()
res_shift = stokes.resonance_frequency_shift(osc_frequency, osc_radius, osc_density,
viscous_penetration_depth_SVP(osc_frequency, TemperatureK),
meanfreepath_SVP(TemperatureK),
density(PressureBar), meanfreepath_adjustment, ballistic_switch)
return res_shift
def resonance_width_obj(ObjOscillator, TemperatureK, PressureBar):
"""
- Calculates frequency width (damping) of an oscillator in dilute mixture for a given oscillator.
-
- Made from the old fortran code by Bradley, parameters are tuned for the Vibrating wires
Much more sophistificated than a standard Stokes model
-
- ObjOscillator: Oscillator object (wire or tuning fork) from mod_oscillator
- TemperatureK: temperature of helium mixture at SVP, the module will not work correctly above ~100mK
- """
osc_radius = __get_charatersictic_size(ObjOscillator)
osc_frequency = ObjOscillator.frequency_vacuum
osc_density = ObjOscillator.density()
res_width = stokes.resonance_width(osc_frequency, osc_radius, osc_density,
viscous_penetration_depth(osc_frequency, TemperatureK, PressureBar),
meanfreepath(TemperatureK, PressureBar),
density(PressureBar), meanfreepath_adjustment, ballistic_switch)
return res_width
def resonance_width_obj_SVP(ObjOscillator, TemperatureK, PressureBar = 0.0):
"""
- Calculates frequency width (damping) of an oscillator in dilute mixture for a given oscillator.
-
- Made from the old fortran code by Bradley, parameters are tuned for the Vibrating wires
Much more sophistificated than a standard Stokes model
-
- ObjOscillator: Oscillator object (wire or tuning fork) from mod_oscillator
- TemperatureK: temperature of helium mixture at SVP, the module will not work correctly above ~100mK
- """
osc_radius = __get_charatersictic_size(ObjOscillator)
osc_frequency = ObjOscillator.frequency_vacuum
osc_density = ObjOscillator.density()
res_width = stokes.resonance_width(osc_frequency, osc_radius, osc_density,
viscous_penetration_depth_SVP(osc_frequency, TemperatureK),
meanfreepath_SVP(TemperatureK),
density(PressureBar), meanfreepath_adjustment, ballistic_switch)
return res_width
def temperature_from_width_obj(ObjOscillator, currentWidthHz, PressureBar):
"""
- Calculates the temperature of 3He normal fluid from the current width for a given oscillator.
-
- Made from old fortran code by Bradley, parameters are tuned for the Vibrating wires
Much more sophisticated than a standard Stokes model
-
- ObjOscillator: Oscillator object (wire or tuning fork) from mod_oscillator
- TemperatureK: temperature of helium mixture at SVP
- """
# define required temperature range, the module will not work correctly above ~100mK
TemperatureK = np.linspace(temperature_critical_superfluid(PressureBar), 0.2, num=10000) # generate temperature array
# Calculate resonance width for all temperatures
res_width = resonance_width_obj(ObjOscillator, TemperatureK, PressureBar)
# change float into numpy array for function len() to work
try:
len(currentWidthHz)
except:
currentWidthHz = np.array([currentWidthHz])
currentWidthHz = np.array(currentWidthHz)
currentTemperatureK = np.tile(np.NaN,len(currentWidthHz)) # array of NaN
for tempindex in range(len(currentTemperatureK)):
# Find the closest width an hence the temperature
minindex = np.argmin(np.abs(res_width - np.tile(currentWidthHz[tempindex], len(TemperatureK))))
currentTemperatureK[tempindex] = TemperatureK[minindex]
return currentTemperatureK
def temperature_from_width_obj_SVP(ObjOscillator, currentWidthHz, PressureBar = 0.0):
"""
- Calculates the temperature of 3He normal fluid from the current width for a given oscillator.
-
- Made from old fortran code by Bradley, parameters are tuned for the Vibrating wires
Much more sophisticated than a standard Stokes model
-
- ObjOscillator: Oscillator object (wire or tuning fork) from mod_oscillator
- TemperatureK: temperature of helium mixture at SVP
- """
Max_valid_temperature = 1.6 #[K]
# define required temperature range, the module will not work correctly above ~100mK
TemperatureK = np.linspace(temperature_critical_superfluid(PressureBar),Max_valid_temperature,num=60000) # generate temperature array
# Calculate resonance width for all temperatures
res_width = resonance_width_obj(ObjOscillator, TemperatureK, PressureBar)
# change float into numpy array for function len() to work
try:
len(currentWidthHz)
except:
currentWidthHz = np.array([currentWidthHz])
currentWidthHz = np.array(currentWidthHz)
currentTemperatureK = np.tile(np.NaN,len(currentWidthHz)) # array of NaN
for tempindex in range(len(currentTemperatureK)):
# Find the closest width an hence the temperature
minindex = np.argmin(np.abs(res_width - np.tile(currentWidthHz[tempindex], len(TemperatureK))))
currentTemperatureK[tempindex] = TemperatureK[minindex]
return currentTemperatureK
##############################################################################
### Superfluid liquid parameters
##############################################################################
def energy_gap_in_low_temp_limit(PressureBar):
return gap_coeff * temperature_critical_superfluid(PressureBar) * Boltzmann_const
def real_squashing_energy_in_low_temp_limit(PressureBar):
return np.sqrt(8./5.) * energy_gap_in_low_temp_limit(PressureBar)
def imaginary_squashing_energy_in_low_temp_limit(PressureBar):
return np.sqrt(12./5.) * energy_gap_in_low_temp_limit(PressureBar)
def pair_breaking_energy_in_low_temp_limit(PressureBar):
return 2 * energy_gap_in_low_temp_limit(PressureBar)
def pair_breaking_superfluid_velocity_in_low_temp_limit(PressureBar, energy_gap_suppression=1.0):
return energy_gap_suppression * energy_gap_in_low_temp_limit(PressureBar) / (Fermi_momentum(PressureBar))
def real_squashing_superfluid_velocity_in_low_temp_limit(PressureBar, energy_gap_suppression=1.0):
return (energy_gap_suppression * np.sqrt(5. / 8.) * energy_gap_in_low_temp_limit(PressureBar) /
Fermi_momentum(PressureBar))
def imaginary_squashing_superfluid_velocity_in_low_temp_limit(PressureBar, energy_gap_suppression=1.0):
return (energy_gap_suppression * np.sqrt(5. / 12.) * energy_gap_in_low_temp_limit(PressureBar) /
Fermi_momentum(PressureBar))
def Landau_velocity(PressureBar):
"""For a given pressure[bar] function returns the Landau velocity of helium-3 [m s-1].
based on Greywall
; http://dx.doi.org/
''
"""
# change float into numpy array for function len() to work
try:
len(PressureBar)
except:
PressureBar = np.array([PressureBar])
return energy_gap_in_low_temp_limit(PressureBar) / Fermi_momentum(PressureBar)
def density_superfluid(TemperatureK, PressureBar):
"""For a given pressure[bar] function returns the effective helium-3 density in superfluid [kg m^3].
based on Greywall
; http://dx.doi.org/
''
"""
# change float into numpy array for function len() to work
try:
len(PressureBar)
except:
PressureBar = np.array([PressureBar])
# print(mass_effective(PressureBar) * yoshidafunction_0(TemperatureK / temperature_critical_superfluid(PressureBar)) / \
# (1.0 + Fermi_parameterF1(PressureBar) * yoshidafunction_0(TemperatureK / temperature_critical_superfluid(PressureBar)) / 3.0))
density_effective = density(PressureBar) * mass_effective(PressureBar) * yoshidafunction_0(TemperatureK / temperature_critical_superfluid(PressureBar)) / \
(1.0 + Fermi_parameterF1(PressureBar) * yoshidafunction_0(TemperatureK / temperature_critical_superfluid(PressureBar)) / 3.0)
return density_effective
def temperature_critical_superfluid(PressureBar):
"""For a given pressure[bar] function returns the transition temperature for superfluidity [K].
based on Greywall
; http://dx.doi.org/
''
"""
CritTempPoly = [0.53010918e-7,-0.57248644e-5,0.25685169e-3,-0.69302185e-2,0.13867188,0.92938375]
# change float into numpy array for function len() to work
try:
len(PressureBar)
except:
PressureBar = np.array([PressureBar])
return 1.0e-3 * np.polyval(CritTempPoly, PressureBar)
def coherence_length(PressureBar):
"""For a given pressure[Bar] returns the coherence length [m].
Function is valid between 0 and 35bars
based on D.I. Bradley et al.
"""
return Plankbar_const * Fermi_velocity(PressureBar) / (2.0 * np.pi* Boltzmann_const * temperature_critical_superfluid(PressureBar))
def yoshidafunction_0(reduced_T):
"""
% yosida functions Y0
% CHH expression: t is reduced temperature (T/Tc)
% ts is their scaled temperature
"""
# change float into numpy array for function len() to work
try:
len(reduced_T)
except:
reduced_T = np.array([reduced_T])
Tbelow0p94 = [-1.367, 4.625, -0.88, 3.454]
Tabove0p94 = [1.985, -0.985]
scaledT = np.polyval(yoshida_scaledT_poly, reduced_T) * reduced_T
yoshidabelow0p94 = np.exp(-1.76388 / scaledT) * np.polyval(Tbelow0p94, scaledT) / np.sqrt(scaledT)
yoshidaabove0p94 = np.polyval(Tabove0p94, scaledT)
return (reduced_T >= np.tile(0.94,len(reduced_T))) * yoshidaabove0p94 + (reduced_T < np.tile(0.94,len(reduced_T))) * yoshidabelow0p94
def yoshidafunction_5(reduced_T):
"""
% yosida functions Y5
% CHH expression: t is reduced temperature (T/Tc)
% ts is their scaled temperature
"""
# change float into numpy array for function len() to work
try:
len(reduced_T)
except:
reduced_T = np.array([reduced_T])
Tbelow0p80 = [0.392, -1.425, 1.1958, 0.10177]
scaledT = np.polyval(yoshida_scaledT_poly, reduced_T) * reduced_T
yoshidabelow0p80 = np.exp(1.76388 / scaledT) * np.polyval(Tbelow0p80, scaledT) / np.sqrt(scaledT)
yoshidaabove0p80 = np.exp(1.76388 / scaledT) * (0.19847 + 0.335 * np.sqrt(1-scaledT)) / np.sqrt(scaledT)
return (reduced_T >= np.tile(0.80,len(reduced_T))) * yoshidaabove0p80 + (reduced_T < np.tile(0.80,len(reduced_T))) * yoshidabelow0p80
def yoshidafunction_6(reduced_T):
"""
% yosida functions Y5
% CHH expression: t is reduced temperature (T/Tc)
% ts is their scaled temperature
"""
# change float into numpy array for function len() to work
try:
len(reduced_T)
except:
reduced_T = np.array([reduced_T])
Tbelow0p90 = [4.1, -2.117, 0.4467, 2.402]
Tabove0p90 = [-7.5, 13.275, -4.517]
scaledT = np.polyval(yoshida_scaledT_poly, reduced_T) * reduced_T
yoshidabelow0p90 = np.exp(-1.76388 / scaledT) * np.polyval(Tbelow0p90, scaledT)
yoshidaabove0p90 = 1 - np.sqrt(1 - scaledT) * np.polyval(Tabove0p90, scaledT)
return (reduced_T >= np.tile(0.90,len(reduced_T))) * yoshidaabove0p90 + (reduced_T < np.tile(0.90,len(reduced_T))) * yoshidabelow0p90
def heat_capacity_Cv_B_phase(TemperatureK, PressureBar):
"""
Calculates the heat capacity under constant volume. Uses equation from Vollhardt and Wolfle: The Superfluid Phases
of Helium 3 p84.
:param TemperatureK: The temperature in Kelvin
:param PressureBar: The pressure in bar
:return: The heat capacity in J / m ^3 / K
"""
gap = energy_gap_in_low_temp_limit(PressureBar)
cv = np.sqrt(2 * np.pi) * Boltzmann_const * density_of_states(PressureBar) * gap
cv = cv * np.power(gap / (Boltzmann_const * TemperatureK), 3./2.) * np.exp(-1 * gap / (Boltzmann_const * TemperatureK))
return cv # J / m3 / K
def heat_capacity_Cv_B_phase_intergral_from_0(TemperatureK, PressureBar):
"""
Returns the definite integral of the heat capacity from absolute zero with respect to temperature. Uses equation
from Vollhardt and Wolfle: The Superfluid Phases of Helium 3 p84.
:param TemperatureK: The temperature in Kelvin
:param PressureBar: The pressure in bar
:return: The energy per unit volume in J / m^3
"""
gap = energy_gap_in_low_temp_limit(PressureBar)
cv = np.sqrt(2 * np.pi) * Boltzmann_const * density_of_states(PressureBar) * gap
intergral = cv * np.sqrt(np.pi) * gap / Boltzmann_const * erfc(np.sqrt(gap / (Boltzmann_const * TemperatureK)))
return intergral # J / m3
def viscosity_superfluid(TemperatureK, PressureBar = 0.0):
"""For a given pressure[Bar] and temperature[K] array returns the effective viscosity in superfluid helium-3 [Pa s].
based on tony's Shaun's calculations
only works for T < superfluidTc
a plot of CHH reduced viscosity gives the following reasonable
form. Basically, LOG( redvis) vz sqrt(1-T)^.5 reasonably slow
"""
# change float into numpy array for function len() to work
try:
len(TemperatureK)
except:
TemperatureK = np.array([TemperatureK])
redT = TemperatureK / temperature_critical_superfluid(PressureBar)
redviscoeff_bl0p6 = 0.11
redviscoeff_bl0p7 = 10.0**(-0.9586-0.8562*(np.sqrt(1-redT)-np.sqrt(0.4)))
redviscoeff_bl0p8 = 10.0**(-0.8861-0.6183*(np.sqrt(1-redT)-np.sqrt(0.3)))
redviscoeff_bl0p9 = 10.0**(-0.8239-1.4172*(np.sqrt(1-redT)-np.sqrt(0.2)))
redviscoeff_bl0p95 = 10.0**(-0.6383-1.7352*(np.sqrt(1-redT)-np.sqrt(0.1)))
redviscoeff_bl0p975 = 10.0**(-0.4776-1.6177*(np.sqrt(1-redT)-np.sqrt(0.05)))
redviscoeff_bl1p0 = 10.0**(-0.3716-2.3503*(np.sqrt(1-redT)-np.sqrt(0.025)))
redvis = (redT <= np.tile(0.6,len(redT))) * redviscoeff_bl0p6 + \
(redT >= np.tile(0.6,len(redT))) * (redT < np.tile(0.7,len(redT))) * redviscoeff_bl0p7 + \
(redT >= np.tile(0.7,len(redT))) * (redT < np.tile(0.8,len(redT))) * redviscoeff_bl0p8 + \
(redT >= np.tile(0.8,len(redT))) * (redT < np.tile(0.9,len(redT))) * redviscoeff_bl0p9 + \
(redT >= np.tile(0.9,len(redT))) * (redT < np.tile(0.95,len(redT))) * redviscoeff_bl0p95 + \
(redT >= np.tile(0.95,len(redT))) * (redT < np.tile(0.975,len(redT))) * redviscoeff_bl0p975 + \
(redT >= np.tile(0.975,len(redT))) * (redT < np.tile(1.0,len(redT))) * redviscoeff_bl1p0 + \
(redT >= np.tile(1.0,len(redT))) * 1.0
return redvis * viscosity(temperature_critical_superfluid(PressureBar), PressureBar)
def slip_length_superfluid(TemperatureK, PressureBar):
"""
% zeta functions: effective slip length
% CHH expression: t is reduced temperature (T/Tc)
% ts is their scaled temperature
"""
return 0.5*yoshidafunction_5(TemperatureK/temperature_critical_superfluid(PressureBar)) * viscosity_superfluid(TemperatureK) /\
viscosity_over_meanfreepath(PressureBar)
def group_velocity_superfluid(TemperatureK, PressureBar):
"""
Returns the approximate group velocity for helium-3 superfluid B
:param TemperatureK: Temperature in Kelvin
:param PressureBar: Pressure in bar
:return: Approximate group velocity in meters per second
"""
return Fermi_velocity(PressureBar) * np.sqrt(TemperatureK /
(gap_coeff * temperature_critical_superfluid(PressureBar)))
def meanfreepath_superfluid(TemperatureK, PressureBar):
"""For a given temperature[K] and pressure returns mean free path in superfluid He3 [???].
Function is valid between ~?mK and ?K
based on D.I. Bradley et al.
"""
return viscosity_superfluid(TemperatureK, PressureBar) / \
(viscosity_over_meanfreepath(PressureBar) * yoshidafunction_6(TemperatureK/temperature_critical_superfluid(PressureBar)))
def meanfreepath_adjustment_superfluid(TemperatureK, PressureBar):
"""For a given temperature[K] and pressure returns mean free path adjustment (fudge factor alpha) in superfluid He3 [???].
Function is valid between ~?mK and ?K
based on D.I. Bradley et al.
"""
return 1.156 * meanfreepath_adjustment / (yoshidafunction_5(TemperatureK/temperature_critical_superfluid(PressureBar))*yoshidafunction_6(TemperatureK/temperature_critical_superfluid(PressureBar)))
def viscous_penetration_depth_superfluid(FrequencyHz, TemperatureK, PressureBar):
"""
- Calculates the viscous penetration depth for a given oscillator with frequency(Hz) in He3 fluid.
-
- Uses delta = sqrt(eta/(density_nf * pi * omega)
-
- FrequencyHz: frequency of oscillator
- TemperatureK: temperature of helium mixture at SVP
- """
deltaM = osc.viscous_penetration_depth(2.0 * FrequencyHz, viscosity_superfluid(TemperatureK, PressureBar),
density_superfluid(TemperatureK, PressureBar))
#double frequency is used to be consistent with an old library
return deltaM
def resonance_frequency_shift_superfluid_obj(ObjOscillator, TemperatureK, PressureBar):
"""
- Calculates frequency shift of an oscillator in normal He3 for a given oscillator.
-
- Made from the old fortran code by Bradley, parameters are tuned for the Vibrating wires
-
- ObjOscillator: Oscillator object (wire or tuning fork) from mod_oscillator
- TemperatureK: temperature of helium mixture at SVP, the module will not work correctly above ~100mK
- """
osc_radius = ObjOscillator._diameter / 2.0
osc_frequency = ObjOscillator.frequency_vacuum
osc_density = ObjOscillator.density()
res_shift = stokes.resonance_frequency_shift_superfluidHe3B(osc_frequency, osc_radius, osc_density,
viscous_penetration_depth_superfluid(osc_frequency, TemperatureK, PressureBar),
meanfreepath_superfluid(TemperatureK, PressureBar),
slip_length_superfluid(TemperatureK, PressureBar),
density_superfluid(TemperatureK, PressureBar),
meanfreepath_adjustment_superfluid(TemperatureK, PressureBar), ballistic_switch)
return res_shift
def resonance_width_superfluid_obj(ObjOscillator, TemperatureK, PressureBar):
"""
- Calculates frequency width (damping) of an oscillator in dilute mixture for a given oscillator.
-
- Made from the old fortran code by Bradley, parameters are tuned for the Vibrating wires
Much more sophistificated than a standard Stokes model
-
- ObjOscillator: Oscillator object (wire or tuning fork) from mod_oscillator
- TemperatureK: temperature of helium mixture at SVP, the module will not work correctly above ~100mK
- """
osc_radius = ObjOscillator._diameter / 2.0
osc_frequency = ObjOscillator.frequency_vacuum
osc_density = ObjOscillator.density()
res_width = stokes.resonance_width_superfluidHe3B(osc_frequency, osc_radius, osc_density,
viscous_penetration_depth_superfluid(osc_frequency, TemperatureK, PressureBar),
meanfreepath_superfluid(TemperatureK, PressureBar),
slip_length_superfluid(TemperatureK, PressureBar),
density_superfluid(TemperatureK, PressureBar),
meanfreepath_adjustment_superfluid(TemperatureK, PressureBar), ballistic_switch)
return res_width
def temperature_superfluid_from_width_obj(ObjOscillator, currentWidthHz, PressureBar):
"""
- Calculates the temperature of the cell based on the current width for a given oscillator.
-
- Made from old fortran code by Bradley, parameters are tuned for the Vibrating wires
Much more sophistificated than a standard Stokes model
-
- ObjOscillator: Oscillator object (wire or tuning fork) from mod_oscillator
- TemperatureK: temperature of helium mixture at SVP
- """
# define required temperature range, the module will not work correctly above ~100mK
TemperatureK = np.linspace(0.1*temperature_critical_superfluid(PressureBar),temperature_critical_superfluid(PressureBar),num=1000) # generate temperature array
# Calculate resonance width for all temperatures
res_width = resonance_width_superfluid_obj(ObjOscillator, TemperatureK, PressureBar)
# change float into numpy array for function len() to work
try:
len(currentWidthHz)
except:
currentWidthHz = np.array([currentWidthHz])
currentWidthHz = np.array(currentWidthHz)
currentTemperatureK = np.tile(np.NaN,len(currentWidthHz)) # array of NaN
for tempindex in range(len(currentTemperatureK)):
# Find the closest width an hence the temperature
minindex = np.argmin(np.abs(res_width - np.tile(currentWidthHz[tempindex], len(TemperatureK))))
currentTemperatureK[tempindex] = TemperatureK[minindex]
return currentTemperatureK
def width_superfluid_ballistic_from_temperature(TemperatureK, coeff_He3B_Twidth, gapcoefficient = gap_coeff,
PressureBar = 0.0):
"""
- Calculates the thermalwidth an oscillator in the ballistic regime of He3 cell
-
TemperatureK: temperature of helium-3 in K
critical_temperature: critical temperature of superfluid transition [K]
coeff_He3B_Twidth: coefficent for the wire (fork), size and material dependent
gapcoeffcient: superfluid gap 1.76 according to BCS theory
- return: thermal width of the oscillator
- """
return coeff_He3B_Twidth * np.exp(-gapcoefficient * temperature_critical_superfluid(PressureBar) / TemperatureK )
def temperature_superfluid_ballistic_from_width(thermalwidth, coeff_He3B_Twidth, gapcoefficient = gap_coeff,
PressureBar = 0.0):
"""
- Calculates the temperature of He3 cell in the ballistic regime only based on the current width for an oscillator.
-
- ObjOscillator: Oscillator object (wire or tuning fork) from mod_oscillator
thermalwidth: thermal width of the oscillator
critical_temperature: critical temperature of superfluid transition [K]
coeff_He3B_Twidth: coefficent for the wire (fork), size and material dependent
gapcoeffcient: superfluid gap 1.76 according to BCS theory
- return: temperature of helium-3 in K
- """
return (-gapcoefficient * temperature_critical_superfluid(PressureBar)) / np.log(thermalwidth / coeff_He3B_Twidth)
def temperature_superfluid_ballistic_widthcoeff(wirewidth, wirecrossection, wiredensity,
PressureBar = 0.0, gamma_coefficient = gamma_coefficient):
"""
- Calculates the width coefficient for the vibrating object in the ballistic regime
-
- wirewidth: wire or tuning fork width