ABLATE Source Documentation  0.12.34
ablate::radiation::SurfaceRadiation Class Reference
+ Inheritance diagram for ablate::radiation::SurfaceRadiation:

Public Member Functions

 SurfaceRadiation (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 Initialize (const ablate::domain::Range &cellRange, ablate::domain::SubDomain &subDomain) override
 
PetscReal SurfaceComponent (const PetscReal normal[], PetscInt iCell, PetscInt nphi, PetscInt ntheta) override
 
virtual void GetSurfaceIntensity (PetscReal *intensity, PetscInt faceId, PetscReal temperature, PetscReal emissivity=1.0, PetscReal absorptivity=1.0)
 
- 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 Setup (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 void ParticleStep (ablate::domain::SubDomain &subDomain, DM faceDM, const PetscScalar *faceGeomArray, DM radReturn, PetscInt nlocalpoints, PetscInt nglobalpoints)
 Routine to move the particle one step. More...
 
virtual void IdentifyNewRaysOnRank (domain::SubDomain &subDomain, DM radReturn, PetscInt nlocalpoints)
 If this local rank has never seen this search particle before, then it needs to add a new ray segment to local memory and record its index. More...
 
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 face id to range index
 
- 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)
 
virtual void SetBoundary (CellSegment &raySegment, PetscInt index, Identifier identifier)
 
- 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

◆ GetClassType()

static std::string ablate::radiation::SurfaceRadiation::GetClassType ( )
inlinestatic

Represents the name of the class for logging and other utilities

Returns

◆ GetSurfaceIntensity()

virtual void ablate::radiation::SurfaceRadiation::GetSurfaceIntensity ( PetscReal *  intensity,
PetscInt  faceId,
PetscReal  temperature,
PetscReal  emissivity = 1.0,
PetscReal  absorptivity = 1.0 
)
inlinevirtual

Compute total intensity (pre computed gains + current loss) with

Parameters
faceIdthe current face id
temperaturethe temperature of the face
emissivitythe emissivity of the surface
Returns

Reimplemented in ablate::radiation::OrthogonalRadiation.

◆ Initialize()

void ablate::radiation::SurfaceRadiation::Initialize ( const ablate::domain::Range cellRange,
ablate::domain::SubDomain subDomain 
)
overridevirtual
Parameters
cellRangeThe range of cells for which rays are initialized

Declare some information associated with the field declarations

< Initialize the fields that have been defined

This will be added to as rays are created on each rank

< Get the geometry vectors

Exact some information associated with the field declarations from the swarm

< Pointer to the coordinate field information

< Pointer to the primary (virtual) coordinate field information

< Pointer to the ray identifier information


Now that the particles have been created, they can be iterated over and each marched one step in space. The global indices of the local ray segment storage can be easily accessed and appended. This forms a local collection of globally index ray segments.

< Recalculate the number of particles that are in the domain

< Count the number of steps that the particles have taken

< WHILE THERE ARE PARTICLES IN ANY DOMAIN

Use the ParticleStep function to calculate the path lengths of the rays through each cell so that they can be stored. This function also sets up the solve particle infrastructure.

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.

< Iterate over the particles present in the domain. How to isolate the particles in this domain and iterate over them? If there are no

IF THE CELL NUMBER IS RETURNED NEGATIVE, THEN WE HAVE REACHED THE BOUNDARY OF THE DOMAIN >> This exits the loop This function returns multiple values if multiple points are input to it Make sure that whatever cell is returned is in the radiation domain Assemble a vector of vectors etc associated with each cell index, angular coordinate, and space step? The boundary has been reached if any of these conditions don't hold

Step 3.5: The cells need to be removed if they are inside a boundary cell. Therefore, after each step (where the particle location is fed in) check for whether the cell is still within the interior region. If it is not (if it's in a boundary cell) then it should be deleted here. Condition for one dimensional domains to avoid infinite rays perpendicular to the x-axis If the domain is 1D and the x-direction of the particle is zero then delete the particle here

If the boundary has been reached by this ray, then add a boundary condition segment to the ray.

Delete the search particle associated with the ray

< Delete the particle!

< Check the point replacing the one that was deleted

Step 4: Push the particle virtual coordinates to the intersection that was found in the previous step. This ensures that the next calculated path length will start from the boundary of the adjacent cell.

< Only use the literal intersection coordinate if it exists. This will be decided above.

Step 5: Instead of using the cell face to step into the opposite cell, step the physical coordinates just beyond the intersection. This avoids issues with hitting corners and potential ghost cell weirdness. It will be slower than the face flipping but it will be more reliable. Update the coordinates of the particle. It doesn't matter which method is used, this will be the same procedure.

< Update the coordinates of the particle to move it beyond the face of the adjacent cell.

< Reset the path length to zero

Restore the fields associated with the particles after all of the particles have been stepped

DMSwarm Migrate to move the ray search particle into the next domain if it has crossed. If it no longer appears in this domain then end the ray segment.

< Migrate the search particles and remove the particles that have left the domain space.

< Update the loop condition. Recalculate the number of particles that are in the domain.

< Update the loop condition. Recalculate the number of particles that are in the domain.

< Pointer to the ray identifier information

< 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

Size each of the entries to hold all of the wavelengths being transported.

= 2 * (the number of independant wavelengths that are being considered). Should be read from absorption model.

Reimplemented from ablate::radiation::Radiation.

◆ SurfaceComponent()

PetscReal ablate::radiation::SurfaceRadiation::SurfaceComponent ( const PetscReal  normal[],
PetscInt  iCell,
PetscInt  nphi,
PetscInt  ntheta 
)
overridevirtual

Computes the normal component for this ray

Parameters
normal
iCell
nphi
ntheta
Returns

Now that we are iterating over every ray identifier in this local domain, we can get all of the particles that are associated with this ray. We will need to sort the rays in order of domain segment. We need to start at the end of the ray and go towards the beginning of the ray.

< Get the normalized face normal (not area scaled)

Update the direction vector of the search particle

Reimplemented from ablate::radiation::Radiation.


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