Changeset 295:2a4c16d406f9


Ignore:
Timestamp:
Sep 15, 2011, 12:01:58 PM (13 years ago)
Author:
Evgeny Stambulchik <Evgeny.Stambulchik@…>
Branch:
default
Phase:
public
Message:

Created pf.base.Radiator class (derived from pf.base.Species).

Location:
source
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • source/class/pf/Application.js

    r282 r295  
    135135    this.gui_n_l.setMaximum(n_u - 1);
    136136   
    137     this.plasma.n_u = n_u;
     137    this.plasma.r.setN_u(n_u);
    138138    this.updateGUI();
    139139}
     
    146146    this.gui_n_u.setMinimum(n_l + 1);
    147147   
    148     this.plasma.n_l = n_l;
     148    this.plasma.r.setN_l(n_l);
    149149    this.updateGUI();
    150150}
     
    463463
    464464                // Make sure n_u > n_l holds during update
    465                 if (this.gui_n_l.getValue() >= this.plasma.n_u) {
    466                     this.gui_n_l.setValue(this.plasma.n_l);
    467                     this.gui_n_u.setValue(this.plasma.n_u);
     465                if (this.gui_n_l.getValue() >= this.plasma.r.getN_u()) {
     466                    this.gui_n_l.setValue(this.plasma.r.getN_l());
     467                    this.gui_n_u.setValue(this.plasma.r.getN_u());
    468468                } else {
    469                     this.gui_n_u.setValue(this.plasma.n_u);
    470                     this.gui_n_l.setValue(this.plasma.n_l);
     469                    this.gui_n_u.setValue(this.plasma.r.getN_u());
     470                    this.gui_n_l.setValue(this.plasma.r.getN_l());
    471471                }
    472472
     
    10961096            l.setRich(true);
    10971097            gl.add(l, {row: 1, column: 0});
    1098             e = new qx.ui.form.Spinner(this.plasma.n_l + 1, this.plasma.n_u, 1000);
     1098            e = new qx.ui.form.Spinner(this.plasma.r.getN_l() + 1,
     1099                this.plasma.r.getN_u(), 1000);
    10991100            gl.add(e, {row: 1, column: 1});
    11001101            e.addListener("changeValue", changeN_u, this);
     
    11041105            l.setRich(true);
    11051106            gl.add(l, {row: 2, column: 0});
    1106             e = new qx.ui.form.Spinner(1, this.plasma.n_l, this.plasma.n_u - 1);
     1107            e = new qx.ui.form.Spinner(1, this.plasma.r.getN_l(),
     1108                this.plasma.r.getN_u() - 1);
    11071109            gl.add(e, {row: 2, column: 1});
    11081110            e.addListener("changeValue", changeN_l, this);
     
    23612363            config.B   = this.plasma.B  ;
    23622364
    2363             config.n_u = this.plasma.n_u;
    2364             config.n_l = this.plasma.n_l;
     2365            config.n_u = this.plasma.r.getN_u();
     2366            config.n_l = this.plasma.r.getN_l();
    23652367           
    23662368            if (this.prefs.saveFavsWithConfig) {
     
    24262428                this.plasma.B   = config.B/au_fB;
    24272429
    2428                 this.plasma.n_u = config.n_u;
    2429                 this.plasma.n_l = config.n_l;
     2430                this.plasma.r.setN_u(config.n_u);
     2431                this.plasma.r.setN_l(config.n_l);
    24302432               
    24312433                if (this.prefs.saveFavsWithConfig && config.favorites) {
  • source/class/pf/Plasma.js

    r293 r295  
    1212        P_r: 0,
    1313        B  : 0,
    14        
    15         getTransitionEnergy: function()
    16         {
    17             var n_u = this.n_u;
    18             var n_l = this.n_l;
    19             var Z_core = this.r.getQ() + 1;
    20             var m_core = this.r.getM();
    21            
    22             return pf.base.Bohr.transitionEnergy(Z_core, m_core, n_u, n_l);
    23         },
    24        
    25         getFineStructure: function()
    26         {
    27             var n_u = this.n_u;
    28             var n_l = this.n_l;
    29             var Z_core = this.r.getQ() + 1;
    30            
    31             return pf.base.Bohr.transitionFineStructure(Z_core, n_u, n_l);
    32         },
    33        
    34         getMinEnergyDistance: function()
    35         {
    36             var n;
    37             if (this.n_u < this.n_l) {
    38                 n = this.n_l;
    39             } else {
    40                 n = this.n_u;
    41             }
    42            
    43             var Z_core = this.r.getQ() + 1;
    44             var m_core = this.r.getM();
    45            
    46             return pf.base.Bohr.transitionEnergy(Z_core, m_core, n + 1, n);
    47         },
    48        
    49         getNaturalWidth: function()
    50         {
    51             var n_u = this.n_u;
    52             var n_l = this.n_l;
    53             var Z_core = this.r.getQ() + 1;
    54            
    55             return pf.base.Bohr.LymanA(Z_core, n_u) +
    56                    pf.base.Bohr.LymanA(Z_core, n_l);
    57         },
    58        
    59         getOscillatorStrength: function()
    60         {
    61             var n_u = this.n_u;
    62             var n_l = this.n_l;
    63            
    64             return pf.base.Bohr.oscillatorStrength(n_u, n_l);
    65         },
    66        
    67         getEinsteinA: function()
    68         {
    69             var n_u = this.n_u;
    70             var n_l = this.n_l;
    71             var Z_core = this.r.getQ() + 1;
    72             var m_core = this.r.getM();
    73            
    74             return pf.base.Bohr.EinsteinA(Z_core, m_core, n_u, n_l);
    75         },
    76        
    77         getDopplerHwhm: function()
    78         {
    79             var v   = this.r.getThermalVelocity();
    80             var nu  = this.getTransitionEnergy();
    81            
    82             return Math.sqrt(2*Math.log(2))*nu*v/pf.base.Bohr.c;
    83         },
    8414       
    8515        getMicrofieldFrequency: function(s)
     
    14373        getDelta0: function(s)
    14474        {
    145             var n_u = this.n_u;
    146             var n_l = this.n_l;
    147             var Z_core = this.r.getQ() + 1;
     75            var n_u = this.r.getN_u();
     76            var n_l = this.r.getN_l();
     77            var Z_core = this.r.getZcore();
    14878            var ef = s.getHoltsmarkField();
    14979           
     
    15383        getQsHwhm: function(s)
    15484        {
    155             var n_u = this.n_u;
    156             var n_l = this.n_l;
     85            var n_u = this.r.getN_u();
     86            var n_l = this.r.getN_l();
    15787
    15888            var ppi = this.getPpiFactor(s);
     
    227157            var s_hwhm = this.getStarkHwhm();
    228158            var z_hwhm = this.getZeemanSplitting();
    229             var d_hwhm = this.getDopplerHwhm();
     159            var d_hwhm = this.r.getDopplerHwhm();
    230160            return 2*Math.sqrt(s_hwhm*s_hwhm + z_hwhm*z_hwhm + d_hwhm*d_hwhm);
    231161        },
     
    243173        getBremsstrahlungSpectralDensity: function()
    244174        {
    245             var photon_en = this.getTransitionEnergy();
     175            var photon_en = this.r.getTransitionEnergy();
    246176            return this.getBremsstrahlungLosses()/this.e.getT()*
    247177                Math.exp(-photon_en/this.e.getT());
     
    263193        getFreeBoundSpectralDensity: function()
    264194        {
    265             var photon_en = this.getTransitionEnergy();
     195            var photon_en = this.r.getTransitionEnergy();
    266196            return this.getFreeBoundLosses()/this.e.getT()*
    267197                Math.exp(-photon_en/this.e.getT());
     
    355285           
    356286            return 4*Math.PI*lambda*n_e/T_e;
    357         },
    358        
    359         getClassicalIonizationField: function()
    360         {
    361             var Z_core = this.r.getQ() + 1;
    362            
    363             return pf.base.Bohr.classicalIonizationField(Z_core, this.n_u);
    364         },
    365        
    366         getInglisTellerField: function()
    367         {
    368             var Z_core = this.r.getQ() + 1;
    369             var n = this.n_u;
    370            
    371             return Math.pow(Z_core, 3)*
    372                 (2*n + 1)/(6*Math.pow(n, 4)*(n + 1)*(n + 1));
    373287        },
    374288       
     
    425339       
    426340        // Defaults: 1e16 1/cc, 1 eV
    427         this.r = new pf.base.Species("r", m_p,  0,       0, 1.0/E0);
    428         this.e = new pf.base.Species("e", 1.0, -1, 1e16*V0, 1.0/E0);
    429         this.i = new pf.base.Species("i", m_p, +1, 1e16*V0, 1.0/E0);
     341        this.e = new pf.base.Species ("e", 1.0, -1, 1e16*V0, 1.0/E0);
     342        this.i = new pf.base.Species ("i", m_p, +1, 1e16*V0, 1.0/E0);
     343        this.r = new pf.base.Radiator("r", m_p,  0,       0, 1.0/E0);
    430344
    431345        this.P_r = 0;
    432346
    433347        this.B   = 0;
    434 
    435         this.n_u = 2;
    436         this.n_l = 1;
    437348    }
    438349});
  • source/entities.js

    r292 r295  
    125125        nspecies  : 0,
    126126        section   : "spectroscopy",
    127         formula   : "this.plasma.getTransitionEnergy()"
     127        formula   : "this.plasma.r.getTransitionEnergy()"
    128128    },
    129129    {
     
    133133        nspecies  : 0,
    134134        section   : "spectroscopy",
    135         formula   : "this.plasma.getNaturalWidth()"
     135        formula   : "this.plasma.r.getNaturalWidth()"
    136136    },
    137137    {
     
    141141        nspecies  : 0,
    142142        section   : "spectroscopy",
    143         formula   : "this.plasma.getFineStructure()",
     143        formula   : "this.plasma.r.getFineStructure()",
    144144        wikiLink  : "Fine_structure"
    145145    },
     
    150150        nspecies  : 0,
    151151        section   : "spectroscopy",
    152         formula   : "2*this.plasma.getDopplerHwhm()",
     152        formula   : "2*this.plasma.r.getDopplerHwhm()",
    153153        wikiLink  : "Doppler_broadening"
    154154    },
     
    204204        nspecies  : 0,
    205205        section   : "spectroscopy",
    206         formula   : "this.plasma.getMinEnergyDistance()"
     206        formula   : "this.plasma.r.getMinEnergyDistance()"
    207207    },
    208208    {
     
    269269        nspecies  : 0,
    270270        section   : "spectroscopy",
    271         formula   : "this.plasma.getOscillatorStrength()",
     271        formula   : "this.plasma.r.getOscillatorStrength()",
    272272        wikiLink  : "Oscillator_strength"
    273273    },
     
    278278        nspecies  : 0,
    279279        section   : "spectroscopy",
    280         formula   : "this.plasma.getEinsteinA()",
     280        formula   : "this.plasma.r.getEinsteinA()",
    281281        wikiLink  : "Einstein_coefficients"
    282282    },
     
    305305        nspecies  : 0,
    306306        section   : "spectroscopy",
    307         formula   : "pf.base.Bohr.c/this.plasma.getTransitionEnergy()*(2*Math.PI)"
     307        formula   : "pf.base.Bohr.c/this.plasma.r.getTransitionEnergy()*(2*Math.PI)"
    308308    },
    309309
     
    314314        nspecies  : 0,
    315315        section   : "spectroscopy",
    316         formula   : "this.plasma.getTransitionEnergy()/(2*Math.PI)"
     316        formula   : "this.plasma.r.getTransitionEnergy()/(2*Math.PI)"
    317317    },
    318318
     
    447447        nspecies  : 0,
    448448        section   : "spectroscopy",
    449         formula   : "this.plasma.getClassicalIonizationField()"
     449        formula   : "this.plasma.r.getClassicalIonizationField()"
    450450    },
    451451    {
     
    455455        nspecies  : 0,
    456456        section   : "spectroscopy",
    457         formula   : "this.plasma.getInglisTellerField()",
     457        formula   : "this.plasma.r.getInglisTellerField()",
    458458        wikiLink  : "Inglis-Teller_equation"
    459459    },
Note: See TracChangeset for help on using the changeset viewer.