PLUTO  4.0
 All Data Structures Files Functions Variables Enumerations Macros Pages
Functions
ct_emf.c File Reference

Store or retrieve the Electromotive Force (EMF). More...

#include "pluto.h"

Functions

void CT_StoreEMF (const State_1D *state, int beg, int end, Grid *grid)
 
void CT_StoreResistiveEMF (double **res_flx, int beg, int end, Grid *grid)
 
EMFCT_GetEMF (const Data *d, Grid *grid)
 

Detailed Description

This file provides a database functionality for storing or retrieving EMF components and related information at different points and times in the code.

The CT_StoreEMF() function is called immediately after a 1D Riemann solver during the hydro sweeps in order to save Fluxes and characteristic signal velocities into the emf structure for later reuse. The fluxes coming from different sweeps are the different components of the advective part (-v X B) part of the electric field.

This CT_StoreResistiveEMF() function is used to save the electric field components associated with resistive terms only.

The function CT_GetEMF() is used to obtain the edge-centered electric field by properly averaging the EMF components previously stored at the zone faces during the 1D sweeps.

Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Aug 16, 2012

Function Documentation

EMF* CT_GetEMF ( const Data d,
Grid grid 
)

Retrieve EMF by suitable average of 1D face-centered fluxes.

Parameters
[in]d
[in]grid
Returns
a pointer to an edge-centered EMF.
void CT_StoreEMF ( const State_1D state,
int  beg,
int  end,
Grid grid 
)

Store EMF components and related information available during 1D sweeps.

Parameters
[in]statepointer to State_1D structure
[in]beginitial index of computation
[in]endfinal index of computation
[in]gridpointer to Grid structure;
Returns
This function has no return value.
void CT_StoreResistiveEMF ( double **  res_flx,
int  beg,
int  end,
Grid grid 
)

Store resistive part of EMF.

Todo:
some memory could be saved here...