ABLATE Source Documentation  0.12.33
ablate::radiation::RaySharingRadiation Class Reference
+ Inheritance diagram for ablate::radiation::RaySharingRadiation:

Public Member Functions

 RaySharingRadiation (const std::string &solverId, const std::shared_ptr< domain::Region > &region, const PetscInt raynumber, std::shared_ptr< eos::radiationProperties::RadiationModel > radiationModelIn, std::shared_ptr< ablate::monitors::logs::Log >={})
 
void Setup (const ablate::domain::Range &cellRange, ablate::domain::SubDomain &subDomain) override
 
void IdentifyNewRaysOnRank (ablate::domain::SubDomain &subDomain, DM radReturn, PetscInt npoints) override
 
void ParticleStep (ablate::domain::SubDomain &subDomain, DM faceDM, const PetscScalar *faceGeomArray, DM radReturn, PetscInt nlocalpoints, PetscInt nglobalpoints) override
 Routine to move the particle one step. More...
 
void SetBoundary (CellSegment &raySegment, PetscInt index, Identifier identifier) override
 
- Public Member Functions inherited from ablate::radiation::Radiation
 Radiation (const std::string &solverId, const std::shared_ptr< domain::Region > &region, const PetscInt raynumber, std::shared_ptr< eos::radiationProperties::RadiationModel > radiationModelIn, std::shared_ptr< ablate::monitors::logs::Log >={})
 
virtual void Initialize (const ablate::domain::Range &cellRange, ablate::domain::SubDomain &subDomain)
 
void GetIntensity (PetscReal *intensity, PetscInt index, const domain::Range &cellRange, PetscReal temperature, PetscReal kappa)
 
std::string GetId ()
 
eos::ThermodynamicTemperatureFunction GetAbsorptionFunction ()
 
void EvaluateGains (Vec solVec, ablate::domain::Field temperatureField, Vec auxVec)
 
virtual PetscReal SurfaceComponent (const PetscReal normal[], PetscInt iCell, PetscInt nphi, PetscInt ntheta)
 
std::shared_ptr< eos::radiationProperties::RadiationModelGetRadiationModel ()
 provide access to the model used to provided the absorptivity function
 
std::shared_ptr< domain::RegionGetRegion () const
 

Static Public Member Functions

static std::string GetClassType ()
 
- Static Public Member Functions inherited from ablate::radiation::Radiation
static PetscReal GetBlackBodyTotalIntensity (PetscReal temperature, const PetscReal refractiveIndex)
 
static PetscReal GetBlackBodyWavelengthIntensity (const PetscReal temperature, const PetscReal wavelength, const PetscReal refractiveIndex)
 
static std::string GetClassType ()
 

Protected Attributes

ablate::domain::ReverseRange indexLookup
 used to look up from the cell id to range index
 
std::vector< PetscReal > remoteMap
 the indexes mapping to the ray id
 
- Protected Attributes inherited from ablate::radiation::Radiation
DM radSearch = nullptr
 DM which the search particles occupy. This representations the physical particle in space.
 
Vec faceGeomVec = nullptr
 Vector used to describe the entire face geom of the dm. This is constant and does not depend upon region.
 
Vec cellGeomVec = nullptr
 
MPI_Datatype carrierMpiType
 create a data type to simplify moving the carrier
 
PetscInt dim = 0
 Class inputs and Variables. More...
 
PetscInt nTheta
 The number of angles to solve with, given by user input.
 
PetscInt nPhi
 The number of angles to solve with, given by user input (x2)
 
PetscReal minCellRadius {}
 
std::vector< std::vector< CellSegment > > raySegments
 store the local rays identified on this rank. This includes rays that do and do not originate on this rank
 
std::vector< CarrierraySegmentsCalculations
 the calculation over each of the remoteRays. indexed over remote ray
 
PetscInt numberOriginRays
 store the number of originating rays
 
PetscInt numberOriginCells
 store the number of originating rays cells
 
PetscInt raysPerCell
 the number of rays per cell
 
std::vector< unsigned short int > raySegmentsPerOriginRay
 store the number of ray segments for each originating on this rank. This may be zero
 
std::vector< CarrierraySegmentSummary
 a vector of raySegment information for every local/remote ray segment ordered as ray, segment
 
std::vector< PetscReal > gainsFactor
 the factor for each origin ray
 
std::vector< PetscScalar > evaluatedGains
 size up the evaluated gains, this index is based upon order of the requested cells
 
PetscSF remoteAccess = nullptr
 Store the petscSF that is used for pulling remote ray calculation.
 
std::string solverId
 the name of this solver
 
const std::shared_ptr< domain::Regionregion
 the region for which this solver applies
 
const std::shared_ptr< eos::radiationProperties::RadiationModelradiationModel
 model used to provided the absorptivity function
 
eos::ThermodynamicTemperatureFunction absorptivityFunction
 hold a pointer to the absorptivity function
 
eos::ThermodynamicTemperatureFunction emissivityFunction
 
const std::shared_ptr< ablate::monitors::logs::Loglog = nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from ablate::radiation::Radiation
PetscReal FaceIntersect (PetscInt ip, Virtualcoord *virtualcoord, PetscFVFaceGeom *face) const
 Class Methods. More...
 
void UpdateCoordinates (PetscInt ipart, Virtualcoord *virtualcoord, PetscReal *coord, PetscReal adv) const
 
void DeleteOutOfBounds (ablate::domain::SubDomain &subDomain)
 
- Protected Member Functions inherited from ablate::utilities::Loggable< Radiation >
const PetscClassId & GetPetscClassId () const
 
PetscLogEvent RegisterEvent (const char *eventName)
 
void StartEvent (const char *eventName) const
 
void EndEvent () const
 
- Static Protected Attributes inherited from ablate::radiation::Radiation
static constexpr char IdentifierField [] = "identifier"
 
static constexpr char VirtualCoordField [] = "virtual coord"
 

Member Function Documentation

◆ IdentifyNewRaysOnRank()

void ablate::radiation::RaySharingRadiation::IdentifyNewRaysOnRank ( ablate::domain::SubDomain subDomain,
DM  radReturn,
PetscInt  npoints 
)
overridevirtual

Instead of creating new ray segments every time a unique particle enters the process, alien particles will be assigned to an existing ray segment which matches their trajectory.

Parameters
subDomain
radReturn
npoints

Declare some information associated with the field declarations

< Pointer to the ray identifier information

< Pointer to the primary (virtual) coordinate field information

Get all of the ray information from the particle Get the ntheta and nphi from the particle that is currently being looked at. This will be used to identify its ray and calculate its direction.

Check that the particle is in a valid region

Get nTheta

Should be set to (absoluteCellIndex * raysPerCell + angleNumber)

< Another solve particle is added here because the search particle has entered a new domain

< Pointer to the ray identifier information

while we are here, set the return rank. This won't change anything until migrate is called

< Get the fields from the radsolve swarm so the new point can be written to them

< Get the fields from the radsolve swarm so the new point can be written to them

Reimplemented from ablate::radiation::Radiation.

◆ ParticleStep()

void ablate::radiation::RaySharingRadiation::ParticleStep ( ablate::domain::SubDomain subDomain,
DM  faceDM,
const PetscScalar *  faceGeomArray,
DM  radReturn,
PetscInt  nlocalpoints,
PetscInt  nglobalpoints 
)
overridevirtual

Routine to move the particle one step.

This particle step will only write new cell indexes to a ray segment if the particle writing the segment is the first segment in the ray. Being the first segment implies that the particle is native to the process. This way, no redundant cells are written.

Parameters
subDomain
faceDM
faceGeomArray
radReturn
nlocalpoints
nglobalpoints

Check that the particle is in a valid region

Declare some information associated with the field declarations

< Pointer to the primary (virtual) coordinate field information

< Pointer to the ray identifier information

Get all of the ray information from the particle Get the ntheta and nphi from the particle that is currently being looked at. This will be used to identify its ray and calculate its direction.

Check that the particle is in a valid region


The face stepping routine will give the precise path length of the mesh without any error. It will also allow the faces of the cells to be accounted for so that the boundary conditions and the conditions at reflection can be accounted for. This will make the entire initialization much faster by only requiring a single step through each cell. Additionally, the option for reflection is opened because the faces and their normals are now more easily accessed during the initialization. In the future, the carrier particles may want to be given some information that the boundary label carries when the search particle happens upon it so that imperfect reflection can be implemented.

Step 2: Acquire the intersection of the particle search line with the segment or face. In the case if a two dimensional mesh, the virtual coordinate in the z direction will need to be solved for because the three dimensional line will not have a literal intersection with the segment of the cell. The third coordinate can be solved for in this case. Here we are figuring out what distance the ray spends inside the cell that it has just registered.

March over each face on this cell in order to check them for the one which intersects this ray next

< Get the face geometry associated with the current cell

Check every face for intersection with the segment. The segment with the shortest path length for intersection will be the one that physically intercepts with the cell face and not with the nonphysical plane beyond the face.

< Reads the cell location from the current cell

Get the intersection of the direction vector with the cell face Use the plane equation and ray segment equation in order to get the face intersection with the shortest path length This will be the next position of the search particle

< Use plane intersection equation by getting the centroid and normal vector of the face

Step 3: Take this path if it is shorter than the previous one, getting the shortest path. The path should never be zero if the forwardIntersect check is functioning properly.

< Dumb check to ensure that the path length is always updated

Get the shortest path length of all of the faces. The point must be in the direction that the ray is travelling in order to be valid.

Only write the new path lengths if the segment belongs to this rank, otherwise it will just share. Most instances the particle step won't occur on the remotely travelling particles because they are getting teleported We want to make sure they don't write anything anyway

Step 1: Register the current cell index in the rays vector. The physical coordinates that have been set in the previous step / loop will be immediately registered. Because the ray comes from the origin, all of the cell indexes are naturally ordered from the center out

Reimplemented from ablate::radiation::Radiation.

◆ SetBoundary()

void ablate::radiation::RaySharingRadiation::SetBoundary ( CellSegment raySegment,
PetscInt  index,
Identifier  identifier 
)
inlineoverridevirtual

The version of the boundary condition will only set the boundary condition if the particle is native to the rank. This functions the same as the particle step function to prevent overwriting of the segment information by alien particles.

Parameters
raySegment
index
identifier

Reimplemented from ablate::radiation::Radiation.

◆ Setup()

void ablate::radiation::RaySharingRadiation::Setup ( const ablate::domain::Range cellRange,
ablate::domain::SubDomain subDomain 
)
overridevirtual

Creates a reverse range and initial segment collection to provide infrastructure for rays to be shared between processes.

Parameters
cellRange
subDomain

Reimplemented from ablate::radiation::Radiation.


The documentation for this class was generated from the following files: