Message: The Electric field doesn't work Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question The Electric field doesn't work 

Forum: Particles
Date: 18 Oct, 2013
From: yanxin0221 <yanxin0221>

Hi everyone,
   I'm new with geant4.I've got a problem with the electric field! I define an  electric field  in x-direction.And the electrons are emissioned in the y direction in vacuum.But the electric field can't change the movement direction of the electrons .
   Could you give me some idea or advices to solve this problem? Thanks a lot everybody. yours sincerely, Yanxin.
#include "EAElectricFieldSetup.hh"
//#include "EAFieldMessenger.hh"

#include "G4UniformElectricField.hh"
#include "G4UniformMagField.hh"
#include "G4MagneticField.hh"
#include "G4FieldManager.hh"
#include "G4TransportationManager.hh"
#include "G4EquationOfMotion.hh"
#include "G4EqMagElectricField.hh"
#include "G4Mag_UsualEqRhs.hh"
#include "G4MagIntegratorStepper.hh"
#include "G4MagIntegratorDriver.hh"
#include "G4ChordFinder.hh"

#include "G4ExplicitEuler.hh"
#include "G4ImplicitEuler.hh"
#include "G4SimpleRunge.hh"
#include "G4SimpleHeum.hh"
#include "G4ClassicalRK4.hh"
#include "G4HelixExplicitEuler.hh"
#include "G4HelixImplicitEuler.hh"
#include "G4HelixSimpleRunge.hh"
#include "G4CashKarpRKF45.hh"
#include "G4RKG3_Stepper.hh"

#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"

// // Constructors:

EAElectricFieldSetup::EAElectricFieldSetup()
  : fFieldManager(0),
    fChordFinder(0), 
    fEquation(0),
    fEMfield(0),
    fElFieldValue(),
    fStepper(0), 
    fIntgrDriver(0),
    fStepperType(4),    // ClassicalRK4 -- the default stepper
    fMinStep(0.010*mm)  // minimal step of 10 microns
{
  fEMfield = new G4UniformElectricField(
                   G4ThreeVector(250.0*kilovolt/m,0.0,0.0));
  fEquation = new G4EqMagElectricField(fEMfield); 

  fFieldManager = GetGlobalFieldManager();
  //fFieldMessenger = new EAFieldMessenger(this) ;  
 // UpdateField();
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....

EAElectricFieldSetup::EAElectricFieldSetup(G4ThreeVector fieldVector)
  : fFieldManager(0),
    fChordFinder(0), 
    fEquation(0),
    fEMfield(0),
    fElFieldValue(),
    fStepper(0), 
    fIntgrDriver(0),
    fStepperType(4),    // ClassicalRK4 -- the default stepper
    fMinStep(0.010*mm)  // minimal step of 10 microns
{    
  fEMfield = new G4UniformElectricField(fieldVector);
  // GetGlobalFieldManager()->CreateChordFinder(this);
  fEquation = new G4EqMagElectricField(fEMfield); 

  fFieldManager = GetGlobalFieldManager();
 // fFieldMessenger = new EAFieldMessenger(this) ;  
  //UpdateField();
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... //////

EAElectricFieldSetup::~EAElectricFieldSetup()
{
  if (fChordFinder) delete fChordFinder;
  if (fStepper)     delete fStepper;
  if (fEquation)    delete fEquation;   
  if (fEMfield)     delete fEMfield;
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....

G4FieldManager* EAElectricFieldSetup::GetGlobalFieldManager() { // Utility method

  return G4TransportationManager::GetTransportationManager()
           ->GetFieldManager();
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Feedback: Re: The Electric field doesn't work   (Gumplinger Peter - 18 Oct, 2013)
(_ None: Re: The Electric field doesn't work   (yanxin0221 - 18 Oct, 2013)
(_ Feedback: Re: The Electric field doesn't work   (Gumplinger Peter - 21 Oct, 2013)
(_ None: Re: The Electric field doesn't work   (yanxin0221 - 22 Oct, 2013)
(_ Feedback: Re: The Electric field doesn't work   (Gumplinger Peter - 22 Oct, 2013)
 Add Message Add Message
to: "The Electric field doesn't work"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]