ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

17
ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver USER’S GUIDE University of Toulouse, LAPLACE, CNRS-UPS-INP, France ABB Corporate Research, Switzerland December 2016

Transcript of ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

Page 1: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKINv.2.0Zero-DimensionalPLASmaKINeticssolver

USER’SGUIDE

UniversityofToulouse,LAPLACE,CNRS-UPS-INP,France

ABBCorporateResearch,Switzerland

December2016

Page 2: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

2

ABOUT.....................................................................................................................................................................3

SYSTEMREQUIREMENTS...............................................................................................................................3

WHOCANUSEZDPlasKin?.............................................................................................................................3

PHYSICALMODEL..............................................................................................................................................3

GENERALSTRUCTURE.....................................................................................................................................4

STRUCTUREOFINPUTDATAFILE.............................................................................................................5

SectionELEMENTS........................................................................................................................................5

SectionSPECIES..............................................................................................................................................6

SectionBOLSIG................................................................................................................................................6

SectionREACTIONS......................................................................................................................................8

PREPROCESSOR..................................................................................................................................................9

ZDPlasKinMODULE...........................................................................................................................................9

Abriefreviewofmainroutines............................................................................................................10

Thelistofdefinedpublicvariables.....................................................................................................11

Thelistofpublicsubroutines................................................................................................................11

DATASAVEANDVISUALIZATIONOFRESULTS................................................................................15

COMPILATION...................................................................................................................................................15

FREQUENTLYASKEDQUESTIONS...........................................................................................................16

COPYRIGHTSTATEMENT............................................................................................................................17

Page 3: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

3

ABOUT

ZDPlasKin isaFortran90moduledesignedto followthetimeevolutionof thespeciesdensities and gas temperature in non-thermal plasmas with an arbitrarily complexchemistry.ABoltzmannequationsolver(BOLSIG+)incorporatedinZDPlasKinprovidesvaluesofelectrontransportandratecoefficientswhentheelectronenergydistributionfunctionisnon-Maxwellian.

ZDPlasKin is now available as freeware and can be downloaded from the followingaddress:www.zdplaskin.laplace.univ-tlse.fr.

_______________

SYSTEMREQUIREMENTS

ZDPlasKinhasbeentestedandrunswellonMicrosoftWindows,MacOSXorLinuxOS.A Fortran 90 compiler is required. We have tested ZDPlasKin with the followingcompilers: Intel Fortran, Lahey/Fujitsu Fortran, Compaq Fortran and gFortran(availableasfreeware).

_______________

WHOCANUSEZDPlasKin?

TheusermustbeabletowritesimpleFortrancode,eitheradaptingtheexamplemastercodes or starting from scratch and making calls to ZDPlasKin following the callstructuresdefinedintheuser'sguide.

A typical userwith some knowledge of Fortran can learn to use the basic features ofZDPlasKin in about one day. Making use of all the advanced features requiresmoreexperienceandfamiliaritywiththeoptionsavailableintheZDPlasKinlibraryroutines.

SeveraldemoversionsofZDPlasKininexecutableformatareavailablefordownloading.Theseareintendedtoillustratethekindsofproblemsthatcanbesolvedandprovideanoverviewoftheoutputoptions.

_______________

PHYSICALMODEL

The time evolution of the species densities in a plasma can be formulated as a set ofcoupledrateequations.InZDPlasKin,thetimeevolutionof[Ni],densityofspeciesi=1...imax,asrepresentedineq.(1),isdeterminednumericalintegration,startingwithsome

Page 4: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

4

initial conditions defined by the user. The source terms Qij corresponding to thecontributions fromdifferentprocesses j =1 ... jmax are constructedautomatically frominformationprovidedbytheuserintheinputdatafile.Thesourcetermscorrespondingtoreaction(2),forexample,areconstructedusingwithreactionrateRj(3).Thesourcetermsareshownexplicitlyineq.(4).

Theevolutionofthegastemperatureisoptionallytakenintoaccount.Whenincluded,itisdeterminedfromthesolutionoftheheattransportequationintheformgivenin(5)(adiabatic isometric approximation)with known specific gas heat ratio g. The secondterm in the right side is Jouleheatingdue to the electron current and corresponds toelastic election-neutral collisions. It is computed using the BOLSIG+ solver. Jouleheating due to the ion currents is assumed negligible, however, it can be easilyimplementedintotheuser’smastercode. TheheatsourcetermQsrccanbeoptionallyspecifiedbyuser.

_______________

GENERALSTRUCTURE

A 2-step structure was chosen to minimize computational overhead and enhanceexecutionspeed.

Step I: The preprocessor converts the input text file into a customized Fortranmodule with the user-supplied input data for the plasma chemistryincorporateddirectlyintothecode.

StepII:TheusermustprovideashortmastercodetocallZDPlasKinlibraryroutinesthat perform the time integration and update electron transport and ratecoefficientsusingBOLSIG+. Outputfilesarewrittenanddiagnosticroutinesare called from themaster code. Themaster codemust be compiled andlinkedwiththeZDPlasKinFortranroutines.

Page 5: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

5

_______________

STRUCTUREOFINPUTDATAFILE

Theinputdatafileconsistsoffourdifferentsectionsasdescribedbelow.Theinputfileis case non-sensitive and the lines startingwith (#) are treated as a comment. EverysectionstartswiththeNAMEofthesectionandendswithENDandconsistsofoneorafewlines.ThefollowingsectionorderisrecommendedELEMENTS-SPECIES-BOLSIG-REACTIONS.Themaxallowedlengthofalineis256symbols.

SECTIONNAME DESCRIPTION

ELEMENTS Alistofchemicalelementstobeconsideredintheproblem.

SPECIES Alistofspeciestobeconsidered.

BOLSIG(optional)

A list of species for BOLSIG+, a Boltzmann equation solver, thatprovidesvaluesofelectrontransportandratecoefficients forbothMaxwellian and non-Maxwellian electron energy distributionfunction.

REACTIONS Alistofreactionswithcorrespondingconstantrates.

SectionELEMENTS

Contains a list of "element" names to be used in ZDPlasKin. The element names areASCIIformatandseparatedbyoneormorespaces.Theelementnamesmuststartwith

Page 6: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

6

aletterandmustnotcontaina(^),(”),(=)or(!)symbol. Themaxallowedlengthofanelementnameis124symbols.Element(E)isalwayssupposedtobeelectrons.

Example:

ELEMENTSArEEND

N.B.: Here you can declare either the normal elements ofMendeleev’s table (plus theelectrons) or declare some virtual elements with other names to differentiate them.Virtual elements are a flexible tool for simulating various processes within this 0Dapproach (e.g. diffusion losses can be approximated by an equivalent volume loss ofspeciesX producing a speciesX(w)which represents particles having diffused to thewalls.InthiscaseX(w)mustbedeclaredasaspecies.)

SectionSPECIES

Contains the list of species used in following sectionsREACTIONS andBOLSIG. Thespeciesmustnotcontaina(”),(=)or(!)symbol. Themaxallowedlengthofaspeciesnameis124symbols.Species(E)isalwaystreatedaselectrons.Excitedstatesmustbepreceded in parentheses or marked with an asterisk(s) after the species name, forexample,N2(A)orN2*.Thepositive/negativeionsaremarkedas(^+)or(^-)afterthespeciesname,forexample,N4^+.

Aspeciesnamecanbeorganizedusingoneorafewelementaryblocksinthefollowingorder: ... [element name][number of elements][any of *, (), [], and {}][^+ or ^-] ... .N2(A)^+O2(a)^-H2(X[m])ifanexampleofcomplexspecies.

Thespeciesnamesmustbecomposedoftheelementnamesdeclaredabove.

Example:

SPECIESEArAr*Ar^+Ar2^+END

SectionBOLSIG

ThisisanoptionalsectionthatcontainsthelistofspeciestobeusedinthecalculationoftheelectronenergydistributionfunctionintheBOLSIG+solver;allthespeciesmustbepresentinsectionSPECIES.ThiswilltellthesolvertocallBOLSIG+andtousethecrosssections for the listed species in the solution of the Boltzmann equation. The maxallowednumberofspeciesinthissectionis32.

Availableoptionsinthesectionare:• set electron-electron collisions NE/NGAS, where NE/NGAS electron-to-gas

fractionbeyondwhichelectron-electroncollisionsaretaken intoaccount intheBoltzmannsolver(thedefaultvalueis10-5andthemaximumvalueis1.0).Note,

Page 7: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

7

this value can be changed during code execution using ZDPlasKin_set_configroutine;

• set min field EMIN, set max field EMAX, set max points IMAX, and setaccuracyRTOL tomanage the cachingmechanism of BOLSIG+ solver (defaultvaluesare10-1Td,103Td,103,and10-3,respectively);

• set dbfile FILENAME to select the database filename containing the crosssections(defaultisbolsigdb.dat).FILENAMEmustbeincapitallettersforUNIXsystems;

• oneormultipleDENSITY<A>+=<B>whichaddsall setofelectroncollisionalprocessesofspecies<A>tothesetofprocessesforspecies<B>.Typically,itcanbeusedforavoidingelectroncross-sectiondatabasedoublingforsimilarspecies,forexample,thegroundstateandvibrationalstatesofamolecule.

We implemented a cachingmechanism for the results of BOLSIG+ solver in order toincreasecomputationalaffectivityofthepackage.Bydefault,anexponentialfieldmeshisgenerated: EN(i) = EMIN ⋅exp(A ⋅ i) , i=0…IMAX,where A = ln(1+ RTOL) constant ischosentosatisfyrelationEN(i+1) / EN(i) =1+ RTOL .Inthiscase,themaximumnumberofpointsisequalto IMAX = A−1 ⋅ ln(EMAX / EMIN ) . BOLSIG+solverisusedtocomputerequired rates only once for every EN(i) point if otherparameters (gas temperature,fractionalcomposition,etc)havenotchangedtoomuch(relativechangesarelessthanRTOL). For a filed belowEMIN the code computes rates for thisminimum field andextrapolatestheresultslinearly.ThiscachingmechanismcanbeswitchedoffbysettingIMAXto0.Example:

BOLSIGArAr*setelectron-electroncollisions1.0D-3setmaxpoints0setdbfileMYDB.DATEND

Insomecases, thesetof species inBOLSIG section is reducedwithrespect to the fullspecies set in section SPECIES. It means that some of species are not used whenBOLSIG+solverdefineselectrontransportparametersandreactionrates.Awarningisissued as soon as the reduced density (normalized by the total gas density) of such“missing” species exceeds some critical level (1E-3 by default). This can affect theaccuracyofcalculations.

Crosssectiondata

Startingfromversion1.2bwedonotmoredistributeelectroncrosssections.Pleaseusethe followingsite fordownloading:www.lxcat.net. Alldownload fromthissitedata iscompatiblewithZDPlasKinpackage.Beforeupgradingcross-sectiondataormakinganychangesofthisdatafilepleaseconsultthepageHOWTOUSE.

Page 8: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

8

Users are encouraged to reference the original data in publications. Users are alsostrongly encouraged to check the data carefully by comparing with the originalreferences.Pleaseletusknowifyouseeanydiscrepancies.

SectionREACTIONS

Themain section contains a list of reactions in formatR1 + R2 + ... => P1 + P2 + ...followed by several spaces, a sign (!) and a reaction rate with a length of up to 130symbols. There are no limits for the number of reactants or products per reaction;neitheristherealimitforthetotalnumberofreactionsintheinputfile.

ReactionandproducttermsRandPcanbeonefrom

• the species defined in section SPECIES; a short version is also possible, forexample,2N2toreplaceN2+N2;

• xxx_K or xxx_eV record with xxx equal to a non-negative value of energyreleased(inright,products,side)orenergyabsorbed(inleft,reactants,side)forexothermicandendothermicreactions,respectively;

• ANY_SPECIES,ANY_NEUTRAL,ANY_ION_POSITIVE, orANY_ION_NEGATIVE toindicateany,neutral,positiveornegative(exceptelectrons)species,respectively.

Thereactionratefollowingthe(!)symbolcananyofthefollowing:

• anexpressioninFortran90[s-1,cm3s-1,cm6s-1,...];• BOLSIG+ A -> B, to indicate that corresponding constant ratesmust be taken

from BOLSIG+ solver. An expression in Fortran can be used just before theBOLSIG+record.

Example:

REACTIONSE+Ar=>2E+Ar^+!1.0d-7E+Ar=>2E+Ar^+!BOLSIG+Ar->Ar^+E+Ar=>2E+Ar^+!0.1*BOLSIG+Ar->Ar^+ENDIt ispossible tousebrief form for similar reactionsusinggroupsyntax. Agroup@G,whereinGisanyalphabeticalsymbol,willbeenrolledaccordingtosuppliedgrouplist.Group list has to present in the following line in form@G = A B C …, i.e. a list ofsubstitutions delimited with one or many spaces. Multiple groups can be usedsimultaneouslyunderconditionsofequalnumberofelementsineverygroup.

Example:

REACTIONSE+Ar^++@M=>Ar+@M!1.0d-7*@R@M=ArAr*Ar**@R=1.0d01.0d-11.0d-2END

Page 9: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

9

Thelinesstartingwith($)willbecopiedtotheoutputFortranmodule“asis”;theusercan put here any Fortran structures, define variables and functions of externalparameters

• Time,thetimemoment[s]• Tgas,thegastemperature[K]• EN,thereducedelectricfield[Td]• OmegaN,thereducedangularfrequency[cm3s-1]• Te,theelectrontemperature[K]• Vdr,theelectrondriftvelocity[cms-1]• De,theelectrondiffusioncoefficient[cm2s-1]• ANY_SPECIES,ANY_NEUTRAL,ANY_ION_POSITIVE,orANY_ION_NEGATIVE

[cm-3]toindicateany,neutral,positiveornegative(exceptelectrons)species,respectively.

VariablesTe,Vdr andDe are not even defined untilBOLSIG section is configured ininputfile.Example:

REACTIONS$doubleprecision::my_rate$my_rate=1.0D-10*Tgas/300.d0*TeE+Ar->2E+Ar^+!my_rateEND

N.B.:WenoteherethatZDPlasKinpackageoperateswithdirectreactionprocessesonlyanddoesnotconstructalistofinverseprocessesatthemoment.

_______________

PREPROCESSOR

The PREPROCESSOR program (included in ZDPlasKin package) translates the inputdatafileintoaFortrancode.ThesemanticanalysisusedbythePREPROCESSORchecksthateachelement, speciesandreaction isunique,and that thechargeandelementarycomposition isbalanced ineveryreaction. Errormessagesarereturned to theuser iftheseconditionsarenotrespectedintheinputdata.

_______________

ZDPlasKinMODULE

ZDPlasKinmodule is generated byPREPROCESSOR utility and then can be used in amaster code. It gives a set of subroutines that will be used for plasma-chemicalsimulations.

Page 10: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

10

Basically,theminimumusercodemustlooklikefollowing:

programtestuseZDPlasKin ! tousemoduleZDPlasKincallZDPlasKin_init() ! initializationofthemodulecallZDPlasKin_set_conditions() ! setconditionscallZDPlasKin_set_density() ! setinitialdensitiescallZDPlasKin_timestep() ! maincall-timeintegrationendprogramtest

Abriefreviewofmainroutines

Acalltothesubroutineinit()initializesthemoduleandmustbemadebeforecallinganyoftheotherZDPlasKinfunctions.

Themaindatastructuresareaccessiblefromthemastercode,eitherdirectlyaspublicvariablesand/orthroughfunctioncalls.Forexample,speciesdensitiesarestoredinthedensity(i)array,andtheusercanusethisarray inthemastercodetodirectlyset(orget) values. Alternatively, the user can set (or get) values of the species densities bycallingtheset(get)_density("X",dens)subroutine. ZDPlasKinallowstheusertoworkwithspeciesnames"X" rather thanacorrespondingarray index. Ifneeded, thearrayindex i of species X is available from the species_name(:) array or by calling theget_species_index("X",i)subroutine.

The parameters specifying the conditions of calculations can be set or accessed (get)withset(get)_conditions()routines.Requiredparametersarethegastemperatureandthe reduced electric field; optional parameters include the specific heat gas ratio. Alogical switch is used to signal that the evolution of the gas temperature should beincludedinthecalculation.

The principal subroutine supplied for the time integration of the rate equations istimestep(),whichcallsDVODE_F90,animplicitandusuallyveryefficientandaccurateintegrationroutine.VODEisapackageofsubroutinesforthenumericalsolutionoftheinitial-value problem for systems of first-order ordinary differential equations. Thepackage uses the fixed-leading-coefficient Backward Differentiation Formula (BDF)method for stiff systems. An alternate time integration routine is thetimestep_explicit() subroutinewhich is an explicit, first-order accurate, Euler solver.The latter is recommended only for very specific applications (such as an integrationwithasmallfixedtimestep).

Two further routines get_density_total() and get_rates() provide output useful foranalysis: the total density of all species - neutral and charged particle species - totalcharge density, species source terms, reaction rates and a matrix of source terms,respectively.

Subroutinewrite_file() writes an output list of species and reactions as well as thematrixofreactionsourcetermstothecorrespondingfiles.

Theonly configurationsubroutine in themodule isset_config(). It allowssetting theabsoluteandrelativeerrorsfortheDVODEsolver,oritcanbeusedtomanagethesilentoperatingmode(noscreenoutput)andtheregimeofstatisticacquisition.

Page 11: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

11

Thelistofdefinedpublicvariables

integer,parameter:: species_max !numberofspecies

integer,parameter:: reactions_max !numberofreactions

integer,parameter:: species_length !maxlengthofspeciesnames

integer,parameter:: reactions_length !maxlengthofreactionlines

doubleprecision:: density(species_max) !tableofdensities,cm-3

integer:: species_charge(species_max) !speciescharge=+1/0/-1

character(species_length):: species_name(species_max) !tableofspeciesnames

character(reactions_length):: reaction_sign(reactions_max) !tableofreactionlines

logical:: lreaction_block(reactions_max) !selectivereactionblocking

integer,parameter:: species_electrons !indexofelectrons(ifdefined)

character(32),allocatable:: qtplaskin_user_names(:) !user-definedvariablesforQtPlaskinGUIoutputdoubleprecision,allocatable:: qtplaskin_user_data(:)

Thelistofpublicsubroutines

subroutineZDPlasKin_init()Initialization,mustbecalledbeforeanyuseofZDPlasKinfunctions.

subroutineZDPlasKin_set_density(str,DENS,LDENS_CONST)SetsdensityDENSforspeciesstr,optionalflagLDENS_CONSTfixesthedensityatagiven level (no time integrationof this species;defaultvalue isFALSE). Thissubroutinecanbecalledatanytime,notonlyfortheinitialization.

character(*),intent(in) ::str !speciesdoubleprecision,optional,intent(in) ::DENS !cm-3logical,optional,intent(in) ::LDENS_CONST !true/false

subroutineZDPlasKin_get_density(str,DENS,LDENS_CONST)GetsdensityDENS for speciesstr, optional flagLDENS_CONSTgets informationaboutthefixeddensity.

character(*),intent(in) ::str !speciesdoubleprecision,optional,intent(out) ::DENS !cm-3logical,optional,intent(out) ::LDENS_CONST !true/false

subroutineZDPlasKin_get_species_index(str,i)Getsindexofspeciesstrfordirectuseofthedensity(i=1:species_max)array.

character(*),intent(in) ::str !speciesinteger,intent(out) ::i !arrayindex

Page 12: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

12

subroutineZDPlasKin_set_conditions()1Setsgastemperature,reducedelectricfield,reducedangularfrequency,electrontemperature, specific heat gas ratio (default value is1.4), heat source and gasheatingmode (FALSE). Optional logical key SOFT_RESET makes soft reset ofDVODEsolverkeepingalluserdataandconfigurationsunchanged. Thiscanbeuseful if a fast change of input parameters is occurred (much faster than thetypicaltimeofdensitychanges).Itisrecommendednotdothisregularlysinceitcan have a significant impact on the efficiency of the package. UsingELEC_TEMPERATUREassumesMaxwellianenergydistributionforelectrons;thevalueofreducedfieldiscalculatedinthiscasetosatisfyelectronenergybalance.

doubleprecision,optional,intent(in) ::GAS_TEMPERATURE !K::REDUCED_FIELD !Td::REDUCED_FREQUENCY !cm3s-1::ELEC_TEMPERATURE !K::SPEC_HEAT_RATIO !1::HEAT_SOURCE!Wcm-3

logical,optional,intent(in) ::GAS_HEATING !true/false ::SOFT_RESET !true/false

subroutineZDPlasKin_get_conditions()Gets gas temperature GAS_TEMPERATURE, reduced electric fieldREDUCED_FIELD, reduced angular frequencyREDUCED_FREQUENCY, electrontemperature ELEC_TEMPERATURE, drift velocity ELEC_DRIFT_VELOCITY anddiffusion ELEC_DIFF_COEFF coefficients, reduced mobility ELEC_MOBILITY_N,energy mobility ELEC_MU_EPS_N and energy diffusion coefficientELEC_DIFF_EPS_N,electronreducedcollisionalfrequencyELEC_FREQUENCY_N,electron reduced total ELEC_POWER_N, elastic ELEC_POWER_ELASTIC_N andinelastic ELEC_POWER_INELASTIC_N powers. The electron temperature isdefined as 2/3 of average energy determined from Boltzmann calculation.Electron energy distribution function can be returned in table formELEC_EEDF(1:2,1:jmax) where ELEC_EEDF(1,:) and ELEC_EEDF(2,:) return theenergiesandthevaluesof theEEDF,respectively; jmax=128 isrecommended.VariablesELEC_*areonlyavailableifBOLSIGsectionpresentsininputfile.

doubleprecision,optional,intent(out) ::GAS_TEMPERATURE !K::REDUCED_FIELD !Td::REDUCED_FREQUENCY !cm3s-1::ELEC_TEMPERATURE !K::ELEC_DRIFT_VELOCITY !cms-1::ELEC_DIFF_COEFF !cm2s-1::ELEC_MOBILITY_N!cm-1V-1s-1::ELEC_MU_EPS_N !cm-1V-1s-1::ELEC_DIFF_EPS_N !cm-1s-1::ELEC_FREQUENCY_N !cm3s-1::ELEC_POWER_N !eVcm3s-1::ELEC_POWER_ELASTIC_N !eVcm3s-1::ELEC_POWER_INELASTIC_N !eVcm3s-1::ELEC_EEDF(:,:) !eV-eV-3/2

1Hereandbelow,asubroutinewithoptionalin/outvariablescanbeusedasfollows,forexample:callZDPlasKin_set_conditions(GAS_TEMPERATURE=my_temperature).

Page 13: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

13

subroutineZDPlasKin_timestep(time,dtime)Centralsubroutine.Makestimeintegrationfromtimetotime+dtimeusingtheDVODE90 solver. The densities and conditions must be set before using thissubroutine.Hereitisadvisednottoputtimestepstoobig;10-6sisoftenagoodmaximumvalue.Wealsonotethatanychangesinthespeciesdensitiesinuser’smaster code cause additional memory re-allocation procedures in DVODE90solver;inthiscasethepresentsubroutinecanbelessefficientthanexplicitEulermethod(seebelow).

doubleprecision,intent(in) ::time !sdoubleprecision,intent(inout) ::dtime !s

subroutineZDPlasKin_timestep_explicit(time,dtime,error_max,density_min)Alternative routine; makes time integration from time to time + dtime usingexplicit Euler method. Variables error_max and density_min - maximumrelativedensitychangeandtheminimumabsolutedensity-controlthenumberof internal steps keeping D[N] / ( [N] + density_min ) < error_max for anyinternal timestep integration. Optionalnumberof internal steps isused to callZDPlasKin_timestep() routine instead if the required number of timestepsexceedsSWITCH_IMPLICIT.

doubleprecision,intent(in) ::time !sdoubleprecision,intent(inout) ::dtime !sdoubleprecision,intent(in) ::error_max !1

::density_min !cm-3doubleprecision,optional,intent(in) ::SWITCH_IMPLICIT !numberofsteps

subroutineZDPlasKin_get_density_total()Gets total density of all, neutral species, positive and negative ions and totalchargedensity(inelementarycharges).

doubleprecision,optional,intent(out) ::ALL_SPECIES !cm-3::ALL_NEUTRAL !cm-3::ALL_ION_POSITIVE !cm-3::ALL_ION_NEGATIVE !cm-3::ALL_CHARGE !cm-3

subroutineZDPlasKin_get_rates()Get species source termsQi defined in equation (4), reaction ratesRj (3) andmatrix of reactions source terms (should be used after the main subroutineZDPlasKin_timestep()toupdatevalues).VariablesMEAN_*meantimeaveragingstarting from the last call ZDPlasKin_set_config( STAT_ACCUM = .true. ); theycannotbeusedwithoutthiscall.

doubleprecision,optional,intent(out) ::SOURCE_TERMS(species_max) !cm-3s-1::REACTION_RATES(reactions_max) !cm-3s-1::SOURCE_TERMS_MATRIX(species_max,reactions_max) !cm-3s-1::MEAN_DENSITY(species_max) !cm-3::MEAN_SOURCE_TERMS(species_max) !cm-3s-1::MEAN_REACTION_RATES(reactions_max) !cm-3s-1::MEAN_SOURCE_TERMS_MATRIX(species_max,reactions_max) !cm-3s-1

Page 14: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

14

subroutineZDPlasKin_set_config()Sets internal configuration withATOL absolute andRTOL relative errors, theSILENCE_MODE flag for silent operating mode (reduced screen output), theregime of statistic acquisition STAT_ACCUM (see ZDPlasKin_write_file andZDPlasKin_get_rates). QTPLASKIN_SAVE allows auto saving of results inQtPlaskin compatible format. Every operationwith statistic acquisition in thisroutine makes a reset of accumulated results. The electron-to-gas fractionbeyond which electron-electron collisions are taken into account in theBoltzmann solver can be changed BOLSIG_EE_FRAC. Logical flagBOLSIG_IGNORE_GAS_TEMPERATURE allows BOLSIG+ solver to do notrecalculatetheelectronrateswhenthegastemperaturechanges.

doubleprecision,optional,intent(in) ::ATOL !cm-3::RTOL !1::BOLSIG_EE_FRAC !1

logical,optional,intent(in) ::SILENCE_MODE::STAT_ACCUM::QTPLASKIN_SAVE::BOLSIG_IGNORE_GAS_TEMPERATURE

subroutineZDPlasKin_write_file()SavesspeciesandreactionslistsinthefilesFILE_SPECIESandFILE_REACTIONS,respectively, and the matrix of reaction source terms FILE_SOURCE_MATRIX(the matrix can be written only if the STAT_ACCUM flag is activated in theprevioussubroutine.Thisflagcanbeactivatedatanytime,andthencallingthissubroutine towrite thematrix filewillwrite theaveragesource terms foreachspecies and for each reaction).This routineusesFortran flowwithunit =5bydefaultthatcanbechangedbyoptionalFILE_UNITvariable.

character(*),optional,intent(in) ::FILE_SPECIEScharacter(*),optional,intent(in) ::FILE_REACTIONScharacter(*),optional,intent(in) ::FILE_SOURCE_MATRIXinteger,optional,intent(in) ::FILE_UNIT

subroutineZDPlasKin_write_qtplaskin(time,LFORCE_WRITE)Savespre-defined anduser-specific data inqt_*.txt files in a format compatiblewithQtPlaskingraphicalinterface.Theroutewritesoutputdataifsomelevelofrelative change of densities or other parameters from the previous output isreached (10-2 by default). Optional LFORCE_WRITE logical variable allowscontrollingoutputfrequency.

doubleprecision,intent(in) ::FILE_SPECIESlogical,optional,intent(in) ::LFORCE_WRITE

subroutineZDPlasKin_reset()ResetsalldataandconfigurationexceptBOLSIG+ loadeddata,usedasapartofinitialization subroutine. Thishas tobedone ifmany runsareprogrammed inthesamecode(forexample,ifyouwanttomakeonerunwithagivenpressure,thenanotheronewithadifferentpressure,youhavetoresetZDPlasKin).

_______________

Page 15: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

15

DATASAVEANDVISUALIZATIONOFRESULTS

In principal, users have to organize an output of data using standard FORTRANcapabilities.Weencourage,however,savingdatainQtPlaskin-compatibleformat.

Anadaptiveautosaveistriggeredoncallingjustafterinitialization

callZDPlaskin_set_config(QTPLASKIN_SAVE=.true.)!autosaveinQtPlaskinformat

In this case, ZDPlasKin saves all necessary data in qt_*.txt files after every timestep.ManualdatasaveinQtPlaskinformatispossibleusing

callZDPlaskin_write_qtplaskin(time)!manualsaveinQtPlaskinformat

The list of saved data includes temporal dependences of key parameters (reducedelectricfield,gasandelectrontemperatures,electroncurrentdensityandelectricpowerdissipation per unit volume), density of species, reaction source rates and reaction-specificproductionratesofspeciesforsensitivityanalysis.

User-specific data can be optionally saved using qtplaskin_user_names(:) andqtplaskin_user_data(:) arrays. These predefined arrays have to be allocated andupdatedbeforemakingtimestepintegration.Forexample:

callZDPlasKin_set_config(QTPLASKIN_SAVE=.true.)allocate(qtplaskin_user_data(2),qtplaskin_user_names(2))qtplaskin_user_names(1)='myparameter'qtplaskin_user_names(2)='onemoremyparameter'dowhile(time<time_end)qtplaskin_user_data(1)=...qtplaskin_user_data(2)=...callZDPlasKin_timestep(time,dime)enddo

Generated inthiswayoutputcanthenbeanalyzedusingQtPlaskingraphical interfacedeveloped by the TRAPPA group at the Instituto de Astrofísica de Andalucía, CSIC inGranada,Spain. PleaseusethefollowingwebsitefordownloadingsourceorcompleteapplicationsforWindowsandMacOS:www.trappa.es/content/software.

_______________

COMPILATION

Inordertosatisfymoduledependencesitishighlyrecommendedtocompilesourcefilesinthefollowingorder:dvode_f90_m.F90-zdplaskin_m.F90-user_code.F90,andtousetheBOLSIG+binarylibraryduringthelinkingstage.Thisadvisesappliedtobothcommandline and project-based compilations. Although this version of ZDPLASKIN has beentestedwith several freeware and commercial F90 and F95 compilers, the developers

Page 16: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

16

make no guarantees as to accuracy. Please check section FAQs before contacting theauthors.

IMPORTANT: ThePREPROCESSOR translates the input data file into a Fortran code,and thus any changes in the input data file require that the user re-run thePREPROCESSORandre-compilethegeneratedFortrancode.

Note toWindows users: Linking to dynamic library bolsig.dll is usually handled bylinkingtoanimportlibrarybolsig.lib. Threedifferentpairsofdll/libBOLSIG+librariesare supplied to the package: bolsig.dll/lib file contains all caps cdecl functions(ZDPLASKIN_BOLSIG_XXX) which is native format for Intel Fotran compiler,bolsig_g.dll/lib contains lowercase cdecl (zdplaskin_bolsig_xxx_) and recommended touse with Lahey/Fujitsu Fortran and gFortran, bolsig_s contains all caps stdcall(_ZDPLASKIN_BOLSIG_XXX@8)andcanbeusedwithCompaqFortran.

IntelFortrancompiler(checkedforversion10.x)…>ifort[options]dvode_f90_m.F90zdplaskin_m.F90user_code.F90bolsig.lib(windows)…>ifort[options]dvode_f90_m.F90zdplaskin_m.F90user_code.F90bolsig.dylib(macos)…>ifort[options]dvode_f90_m.F90zdplaskin_m.F90user_code.F90bolsig.so(linux)

gFortran(checkedforversion4.x)…>gfortran[options]dvode_f90_m.F90zdplaskin_m.F90user_code.F90bolsig_g.dll(windows)…>gfortran[options]dvode_f90_m.F90zdplaskin_m.F90user_code.F90bolsig.dylib(macos)…>gfortran[options]dvode_f90_m.F90zdplaskin_m.F90user_code.F90bolsig.so(linux)

Lahey/FujitsuFortran95(checkedforversion5.x)…>lf95[options]dvode_f90_m.F90zdplaskin_m.F90user_code.F90bolsig_g.lib(windows)

Donotforgettosetlibrarysearchpath…>exportDYLD_LIBRARY_PATH=.:$DYLD_LIBRARY_PATH(macos)…>exportLD_LIBRARY_PATH=.:$LD_LIBRARY_PATH(linux)

_______________

FREQUENTLYASKEDQUESTIONS

HowshouldIgetstartedusingZDPlasKin?1) Tryfirstusingthesimple2-reactiontestcase.Executethepreprocessorwiththe

kinet.inpinputdatafilecorrespondingtothe2-reactiontestcase.Thencompilethe generatedFortran codewith themaster codeweprovide for the test case.Executethecodeandmakesurethatyournumericalresultsareidenticaltothoseinourtestcase.

2) Do the same test with one of the more complicated examples provided atZDPlasKinwebsite.

3) Thenstartadaptingthemastercodesprovidedwiththeseexamplesuntilyouarefamiliarwiththevarioussubroutinesandoptionsavailable.

4) PuttogetheryourowninputdatafileandyoushouldbereadytouseZDPlasKin!

Page 17: ZDPLASKIN v. 2.0 Zero-Dimensional PLASma KINetics solver ...

ZDPLASKIN:Zero-DimensionalPlasmaKinetics

17

WhatupgradesareplannedforZDPlasKin?ZDPlasKinisnotacommercialprojectanditdoesnothaveanyfinancialsupportatthemoment,soitsfuturedependsonfeedbackwewillhavefromyou.Pleasesendusyourcomments.

_______________

COPYRIGHTSTATEMENT

ZDPlasKin was developed by researchers at LAPLACE, Laboratoire des Plasmas etConversion d'Energie, a laboratory operated jointly by the CNRS, the University ofToulouseandtheInstitutPolytechniqueofToulouse.

Dr.SergeyPANCHESHNYI,formerResearchScientistCNRSDr.BenjaminEISMANN,formerPhDstudentDr.GerjanHAGELAAR,SeniorResearchScientistCNRSDr.LeannePITCHFORD,SeniorResearchScientistCNRS

WeareveryinterestedinhearingyourcommentsaboutZDPlasKin.Whilewewillmakeevery effort to answer questions and help users get started, we cannot guaranteesupport.

Users are kindly requested to send us copies of publications making use of resultsobtainedwith ZDPlasKin for inclusion on the site. Userswilling to share their inputchemistrydatafile(withproperreferencesofcourse)areencouragedtosendtheirfilestousforinclusiononthesite.

Permission to use ZDPlasKin in non-commercial applications is hereby granted,providedthatproperreferenceismadeinpublicationsreportingresultsobtainedusingthissoftware.Atpresent,thepreferredwaytoreferenceZDPlasKinisasfollows(pleasecheckthesiteagainsoonforanupdatedreference):

S.Pancheshnyi,B.Eismann,G.J.M.Hagelaar,L.C.Pitchford,computercodeZDPlasKin(UniversityofToulouse,LAPLACE,CNRS-UPS-INP,Toulouse,France,2008).

ZDPlasKinismadeavailable“asis”,andassistanceandsupportarenotguaranteed.Theauthors make no warranty about the suitability of the software for any purpose.DownloadingZDPlasKinfromthissiteisimplicitacceptanceoftheseconditions.Usersshouldcheckwebsiteperiodicallytoseeifupgradesareavailableoriferrorshavebeenreported. Users interested in negotiating a license to use ZDPlasKin in commercialapplicationsshouldcontacttheauthors.