mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: boundaryRadiationProperties updates
This commit is contained in:
@ -38,36 +38,6 @@ namespace Foam
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::IOobject Foam::radiation::boundaryRadiationProperties::createIOobject
|
|
||||||
(
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const word name
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
IOobject io
|
|
||||||
(
|
|
||||||
name,
|
|
||||||
mesh.time().caseConstant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
);
|
|
||||||
|
|
||||||
if (io.typeHeaderOk<volScalarField>(true))
|
|
||||||
{
|
|
||||||
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
|
|
||||||
return io;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
io.readOpt() = IOobject::NO_READ;
|
|
||||||
return io;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::radiation::boundaryRadiationProperties::boundaryRadiationProperties
|
Foam::radiation::boundaryRadiationProperties::boundaryRadiationProperties
|
||||||
@ -83,12 +53,16 @@ Foam::radiation::boundaryRadiationProperties::boundaryRadiationProperties
|
|||||||
>(mesh),
|
>(mesh),
|
||||||
radBoundaryProperties_()
|
radBoundaryProperties_()
|
||||||
{
|
{
|
||||||
const IOobject boundaryIO
|
IOobject boundaryIO
|
||||||
(
|
(
|
||||||
createIOobject(mesh, boundaryRadiationProperties::typeName)
|
boundaryRadiationProperties::typeName,
|
||||||
|
mesh.time().constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
);
|
);
|
||||||
|
|
||||||
if (boundaryIO.readOpt() == IOobject::MUST_READ_IF_MODIFIED)
|
if (boundaryIO.typeHeaderOk<volScalarField>(true))
|
||||||
{
|
{
|
||||||
radBoundaryProperties_.set
|
radBoundaryProperties_.set
|
||||||
(
|
(
|
||||||
@ -100,17 +74,10 @@ Foam::radiation::boundaryRadiationProperties::boundaryRadiationProperties
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member fucntions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member fucntions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::volScalarField&
|
|
||||||
Foam::radiation::boundaryRadiationProperties::radBoundaryProperties() const
|
|
||||||
{
|
|
||||||
return radBoundaryProperties_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
Foam::tmp<Foam::scalarField>
|
||||||
Foam::radiation::boundaryRadiationProperties::emissivity
|
Foam::radiation::boundaryRadiationProperties::emissivity
|
||||||
(
|
(
|
||||||
const label index,
|
const label patchI,
|
||||||
const label bandI
|
const label bandI
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -118,7 +85,7 @@ Foam::radiation::boundaryRadiationProperties::emissivity
|
|||||||
{
|
{
|
||||||
return refCast<const boundaryRadiationPropertiesFvPatchField>
|
return refCast<const boundaryRadiationPropertiesFvPatchField>
|
||||||
(
|
(
|
||||||
radBoundaryProperties_->boundaryField()[index]
|
radBoundaryProperties_->boundaryField()[patchI]
|
||||||
).emissivity(bandI);
|
).emissivity(bandI);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -129,7 +96,7 @@ Foam::radiation::boundaryRadiationProperties::emissivity
|
|||||||
<< "Please add it"
|
<< "Please add it"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
|
|
||||||
return tmp<scalarField>(new scalarField());
|
return tmp<scalarField>(new scalarField());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,7 +104,7 @@ Foam::radiation::boundaryRadiationProperties::emissivity
|
|||||||
Foam::tmp<Foam::scalarField>
|
Foam::tmp<Foam::scalarField>
|
||||||
Foam::radiation::boundaryRadiationProperties::absorptivity
|
Foam::radiation::boundaryRadiationProperties::absorptivity
|
||||||
(
|
(
|
||||||
const label index,
|
const label patchI,
|
||||||
const label bandI
|
const label bandI
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -145,7 +112,7 @@ Foam::radiation::boundaryRadiationProperties::absorptivity
|
|||||||
{
|
{
|
||||||
return refCast<const boundaryRadiationPropertiesFvPatchField>
|
return refCast<const boundaryRadiationPropertiesFvPatchField>
|
||||||
(
|
(
|
||||||
radBoundaryProperties_->boundaryField()[index]
|
radBoundaryProperties_->boundaryField()[patchI]
|
||||||
).absorptivity(bandI);
|
).absorptivity(bandI);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -164,7 +131,7 @@ Foam::radiation::boundaryRadiationProperties::absorptivity
|
|||||||
Foam::tmp<Foam::scalarField>
|
Foam::tmp<Foam::scalarField>
|
||||||
Foam::radiation::boundaryRadiationProperties::transmissivity
|
Foam::radiation::boundaryRadiationProperties::transmissivity
|
||||||
(
|
(
|
||||||
const label index,
|
const label patchI,
|
||||||
const label bandI
|
const label bandI
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -172,7 +139,7 @@ Foam::radiation::boundaryRadiationProperties::transmissivity
|
|||||||
{
|
{
|
||||||
return refCast<const boundaryRadiationPropertiesFvPatchField>
|
return refCast<const boundaryRadiationPropertiesFvPatchField>
|
||||||
(
|
(
|
||||||
radBoundaryProperties_->boundaryField()[index]
|
radBoundaryProperties_->boundaryField()[patchI]
|
||||||
).transmissivity(bandI);
|
).transmissivity(bandI);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -191,7 +158,7 @@ Foam::radiation::boundaryRadiationProperties::transmissivity
|
|||||||
Foam::tmp<Foam::scalarField>
|
Foam::tmp<Foam::scalarField>
|
||||||
Foam::radiation::boundaryRadiationProperties::reflectivity
|
Foam::radiation::boundaryRadiationProperties::reflectivity
|
||||||
(
|
(
|
||||||
const label index,
|
const label patchI,
|
||||||
const label bandI
|
const label bandI
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -199,7 +166,7 @@ Foam::radiation::boundaryRadiationProperties::reflectivity
|
|||||||
{
|
{
|
||||||
return refCast<const boundaryRadiationPropertiesFvPatchField>
|
return refCast<const boundaryRadiationPropertiesFvPatchField>
|
||||||
(
|
(
|
||||||
radBoundaryProperties_->boundaryField()[index]
|
radBoundaryProperties_->boundaryField()[patchI]
|
||||||
).reflectivity(bandI);
|
).reflectivity(bandI);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -69,12 +69,6 @@ class boundaryRadiationProperties
|
|||||||
autoPtr<volScalarField> radBoundaryProperties_;
|
autoPtr<volScalarField> radBoundaryProperties_;
|
||||||
|
|
||||||
|
|
||||||
// Private member functions
|
|
||||||
|
|
||||||
//- Create IO object if dictionary is present
|
|
||||||
IOobject createIOobject(const fvMesh& mesh, const word) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Declare name of the class and its debug switch
|
// Declare name of the class and its debug switch
|
||||||
@ -84,7 +78,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct given fvMesh
|
//- Construct given fvMesh
|
||||||
boundaryRadiationProperties(const fvMesh&);
|
explicit boundaryRadiationProperties(const fvMesh&);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -92,7 +86,7 @@ public:
|
|||||||
//- Access boundary emissivity on patch
|
//- Access boundary emissivity on patch
|
||||||
tmp<scalarField> emissivity
|
tmp<scalarField> emissivity
|
||||||
(
|
(
|
||||||
const label patchId,
|
const label patchI,
|
||||||
const label bandI = 0
|
const label bandI = 0
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
@ -100,7 +94,7 @@ public:
|
|||||||
//- Access boundary absorptivity on patch
|
//- Access boundary absorptivity on patch
|
||||||
tmp<scalarField> absorptivity
|
tmp<scalarField> absorptivity
|
||||||
(
|
(
|
||||||
const label patchId,
|
const label patchI,
|
||||||
const label bandI = 0
|
const label bandI = 0
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
@ -108,22 +102,18 @@ public:
|
|||||||
//- Access boundary transmissivity on patch
|
//- Access boundary transmissivity on patch
|
||||||
tmp<scalarField> transmissivity
|
tmp<scalarField> transmissivity
|
||||||
(
|
(
|
||||||
const label patchId,
|
const label patchI,
|
||||||
const label bandI = 0
|
const label bandI = 0
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Access boundary reflectivity on patch
|
//- Access boundary reflectivity on patch
|
||||||
tmp<scalarField> reflectivity
|
tmp<scalarField> reflectivity
|
||||||
(
|
(
|
||||||
const label patchId,
|
const label patchI,
|
||||||
const label bandI = 0
|
const label bandI = 0
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
//- Access to radBoundaryProperties
|
|
||||||
const volScalarField& radBoundaryProperties() const;
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~boundaryRadiationProperties();
|
virtual ~boundaryRadiationProperties();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user