Skip to content

Commit

Permalink
updated readme and license
Browse files Browse the repository at this point in the history
  • Loading branch information
mariomerinomartinez committed Jul 17, 2018
1 parent a65d126 commit 21c92d1
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 26 deletions.
2 changes: 1 addition & 1 deletion +dimagno/+postprocessor/fronts_to_arrays.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
MMM20180522
%}
function solution = fronts_to_arrays(data,solution)
% function solution = fronts_to_arrays(data,solution)

frontfiles = dir(fullfile(data.dimagno.simdir,'fronts','*.mat'));

Expand Down
3 changes: 2 additions & 1 deletion +dimagno/+postprocessor/induced_field.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
MMM20180522
%}
function solution = induced_field(data,solution)
% function solution = induced_field(data,solution)

%% Create and prepare induced field object
solution.induced = magnetic_field.library_2d; % Field object (library_2d)
Expand All @@ -25,6 +25,7 @@
I = scatteredInterpolant(solution.z(:),solution.r(:),solution.jtheta(:));
JTHETA = I(solution.induced.ZZ,solution.induced.RR);
JTHETA(data.applied.field_2d(solution.induced.ZZ,solution.induced.RR) > data.applied.field_2d(data.initialfront.front.z_(end),data.initialfront.front.r_(end)) ) = 0; % set to 0 the jtheta of points outside of the plasma.
JTHETA(solution.induced.ZZ<=0 & solution.induced.RR>1) = 0; % set to 0 the jtheta of points outside of the plasma.
clear I; % delete interpolant

% Generate temporary loop_2d object
Expand Down
33 changes: 33 additions & 0 deletions +dimagno/+solver/dMoC_close_kernel.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
%{
This function receives a integration front_2d (Fold) and propagates it
downstream once (Fnew).
%}
function [Fnew] = dMoC_close_kernel(data,Fold)

Fsub = dimagno.front;
Fnew = dimagno.front;

%% Subfront
for i = 1:Fold.n_points-1
p = dimagno.solver.dMoC_inner(data,i+1,i,Fold);
Fsub.setpoint(p,i); clear p;
end

%% Calculate inner
for i = 1:Fsub.n_points-1
p = dimagno.solver.dMoC_inner(data,i+1,i,Fsub);
Fnew.setpoint(p,i); clear p;
end

%% Calculate axis
Fsub.setpoint(Fold.point(1),'prepend');
p = dimagno.solver.dMoC_axis(data,2,1,Fsub);
Fnew.setpoint(p,'prepend'); clear p;

%% Calculate border point
Fsub.setpoint(Fold.point(Fold.n_points),'append');
p = dimagno.solver.dMoC_border(data,Fsub.n_points,Fsub.n_points-1,Fsub);
Fnew.setpoint(p,'append'); clear p;

4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Mario Merino
Copyright (c) 2018 Mario Merino and Eduardo Ahedo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
47 changes: 25 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,37 @@ DIMAGNO is a two-fluid code for the simulation of DIvergent MAgnetic NOzzles for
It uses the method of characteristics to integrate the supersonic
ion equations.

The full version of DIMAGNO was developed since 2009 as part of my MSc and then my PhD theses, and has been used extensively to research the operation and the physics of the plasma flow in a magnetic nozzle. The version contained in this repository is a **refactored** version of that code, created recently with the purpose of making the code open source. As such, the code currently
only includes the basic functionality, and more features will be included gradually. If you are interested in any particular aspect of the code not yet included in the repository, feel free to contact me.
The full version of DIMAGNO was developed since 2009 in the Space Propulsion and Plasmas Research Group
at Universidad Carlos III de Madrid, by Mario Merino and Eduardo Ahedo,
and has been used extensively to research the operation and the physics of the plasma flow in a magnetic nozzle. The version contained in this repository is a (still incomplete) **refactored** version of that code, created recently with the purpose of making the code open source. As such, the code currently
only includes the basic functionality, and more features will be included gradually.
If you are interested in any particular aspect of the code not yet included in the repository, feel free to contact us.

The full description of the model can be found in *E. Ahedo and M. Merino, "Two-dimensional supersonic plasma acceleration in a magnetic nozzle", Physics of Plasmas 17, 073501 (2010)*.

## Installation

Installation requires simply that you
[download DIMAGNO](https://github.com/mariomerinomartinez/dimagno/archive/master.zip)
and add the base directory (the one that contains the `+dimagno` directory)
Installation requires simply that you
[download DIMAGNO](https://github.com/mariomerinomartinez/dimagno/archive/master.zip)
and add the base directory (the one that contains the `+dimagno` directory)
to your Matlab path.

### Dependencies

A recent version of Matlab is needed to run the code.
DIMAGNO has been developed in Matlab R2016b Academic version.
A recent version of Matlab is needed to run the code.
DIMAGNO has been developed in Matlab R2016b Academic version.

DIMAGNO depends on other Matlab packages that you can download from this
GitHub account:
GitHub account:
[magnetic_field](https://github.com/mariomerinomartinez/magnetic_field),
[fluid_plasma](https://github.com/mariomerinomartinez/fluid_plasma),
[utilities](https://github.com/mariomerinomartinez/utilities),
[logger](https://github.com/mariomerinomartinez/logger).
[logger](https://github.com/mariomerinomartinez/logger).
These packages must be installed and in your Matlab path to run DIMAGNO.

## Quick usage guide

All input parameters are configured in the `simrc` function included in the package. To use the code, copy this file as a template to the directory where you will run your simulation from, and edit it to your liking.
All input parameters are configured in the `simrc` function included in the package. To use the code, copy this file as a template to the directory where you will run your simulation from, and edit it to your liking.

After creating a `magnetic_field` and a `fluid_plasma` object using the dependencies listed above, you need to create an initial condition `dimagno.ic`object. You can customize many aspects of these objects and the other parameters in your user `simrc` file, including the name of the folder where the output files will be generated and the type of postprocessing functions that will be run (currently limited to two until I finish refactoring the previous codebase).

Expand All @@ -49,7 +52,7 @@ To run DIMAGNO, pass the path to your `simrc` file to the main program:
```

This will create a number of `.mat` files in the subfolder `fronts` with the raw results of the simulation, and two structures: `data` and `solution`.
The output structure `data` contains all the actual preprocessed inputs used by the program; `solution` contains all the postprocessing results.
The output structure `data` contains all the actual preprocessed inputs used by the program; `solution` contains all the postprocessing results.

*Unforturnately, the current version of DIMAGNO does not come with detailed documentation.*

Expand All @@ -67,23 +70,23 @@ There are also 4 subpackages:
* `preprocessor`: contains a function to perform some preprocessing of the input
* `postprocessor`: functions that the user can select, that will be run after the main simulation loop is completed.
* `solver`: the functions that embody the method of characteristics and enable DIMAGNO to perform a simulation.

### Testing

The test suite of the refactored version of DIMAGNO is still quite minimal.
However, a few tests can be
The test suite of the refactored version of DIMAGNO is still quite minimal.
However, a few tests can be
found in the `/test` subdirectory. These tests can give you a feeling of how to run DIMAGNO on your own. After adding the package to
your Matlab path, you can run all tests by executing `runtests` from this
subdirectory.

## Contributing

If you have any comments for improvement or
are interested in contributing to the continued
development of this or any of my other codes, you can contact us through
If you have any comments for improvement or
are interested in contributing to the continued
development of this or any of our other codes, you can contact us through
[Mario's website](http://mariomerino.uc3m.es/).

## Acknowledging
## Acknowledging

This program is the result of substantial effort. It is released as open
source in the hope that it will be useful to other people. If you find it
Expand All @@ -94,9 +97,9 @@ by citing the main article of the DIMAGNO model,
and/or citing the code directly as:

> Mario Merino (2018). DIMAGNO code: Divergent Magnetic Nozzle plasma flow integrator, [DOI: 10.5281/zenodo.1257295](https://doi.org/10.5281/zenodo.1257295)
> Mario Merino, Eduardo Ahedo (2018). DIMAGNO code: Divergent Magnetic Nozzle plasma flow integrator, [DOI: 10.5281/zenodo.1257295](https://doi.org/10.5281/zenodo.1257295)
## License

Copyright (c) 2018 Mario Merino.
Copyright (c) 2018 Mario Merino and Eduardo Ahedo.
The software is released as open source under the [MIT License](LICENSE.md).

0 comments on commit 21c92d1

Please sign in to comment.