Hello everybody,
I would like to impose a predefined background density in a part of the simulation domain. In the SPISUI plama editor, it is possible to modify the plasma background density with an uniform value, but this value is apparently not taken into account by SPISNUM. I would therefore like to know :
what is (are) the class(es) to be modified in SPISNUM to take this background density into account in the solver ?
what is (are) the py files to be modified in SPISUI to impose a non-uniform background density
As documented in the “controlling NUM from UI” HowTo the background density is not yet in use (see last column “in use” of the arrays of this HowTo).
It was defined in UI so as to be user later as a user-defined background density, probabibly of neutrals to compute charge exchange. You want to use it as a charge density, why not. In any case I am happy to see somebody willing to enter into the code.
So, if you what to consider this backround density as a background charge density, the general scheme is the following:
Retrieve the corresponding object in SPIS/NUM, a ScalVolField:
certainly in SimulationFromUIParams.init() (look at many other parameters extraction examples in that routine).
Pass it to the object that will handle it, i.e. your plasma, an MmfPlasma (add an extra object "ScalVolField backgroundDensity" to MmfPlasma , and define it through a setter, don't modifier the constructor, it would be too heavy)
Add this density at each total plasma density computation in MmfPlasma:
certainly in "computeTotalChargeDensity" method/routine, called by "integrate" method (for that use a method availbale for a ScalVolField such as
add(ScalVolField otherFieldToAdd)
(you get that information preferably through auto-completion in Eclipse (ctrl-space), or in the API documentation (Vol/ScalVolField)
NB: as you see, nothing is to be changed in SPIS/UI for that
Good luck and don’t hesitate to ask again When you’re done, the next step in complexity is to generate ions following that given density (CEX e.g.), you can ask for the same kind of guidance.
JF