Skip to content
Snippets Groups Projects
Commit afc467dc authored by Henry's avatar Henry
Browse files

fvDOM: check mesh is on x-y plane for 2D cases and in x-direction for 1D cases

parent 7bf3fd24
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -49,7 +49,8 @@ namespace Foam ...@@ -49,7 +49,8 @@ namespace Foam
void Foam::radiation::fvDOM::initialise() void Foam::radiation::fvDOM::initialise()
{ {
if (mesh_.nSolutionD() == 3) //3D // 3D
if (mesh_.nSolutionD() == 3)
{ {
nRay_ = 4*nPhi_*nTheta_; nRay_ = 4*nPhi_*nTheta_;
IRay_.setSize(nRay_); IRay_.setSize(nRay_);
...@@ -83,69 +84,84 @@ void Foam::radiation::fvDOM::initialise() ...@@ -83,69 +84,84 @@ void Foam::radiation::fvDOM::initialise()
} }
} }
} }
else // 2D
else if (mesh_.nSolutionD() == 2)
{ {
if (mesh_.nSolutionD() == 2) //2D (X & Y) // Currently 2D solution is limited to the x-y plane
if (mesh_.solutionD()[vector::Z] != -1)
{ {
scalar thetai = piByTwo; FatalErrorIn("fvDOM::initialise()")
scalar deltaTheta = pi; << "Currently 2D solution is limited to the x-y plane"
nRay_ = 4*nPhi_; << exit(FatalError);
IRay_.setSize(nRay_); }
scalar deltaPhi = pi/(2.0*nPhi_);
label i = 0; scalar thetai = piByTwo;
for (label m = 1; m <= 4*nPhi_; m++) scalar deltaTheta = pi;
{ nRay_ = 4*nPhi_;
scalar phii = (2.0*m - 1.0)*deltaPhi/2.0; IRay_.setSize(nRay_);
IRay_.set scalar deltaPhi = pi/(2.0*nPhi_);
label i = 0;
for (label m = 1; m <= 4*nPhi_; m++)
{
scalar phii = (2.0*m - 1.0)*deltaPhi/2.0;
IRay_.set
(
i,
new radiativeIntensityRay
( (
i, *this,
new radiativeIntensityRay mesh_,
( phii,
*this, thetai,
mesh_, deltaPhi,
phii, deltaTheta,
thetai, nLambda_,
deltaPhi, absorptionEmission_,
deltaTheta, blackBody_,
nLambda_, i
absorptionEmission_, )
blackBody_, );
i i++;
)
);
i++;
}
} }
else //1D (X) }
// 1D
else
{
// Currently 1D solution is limited to the x-direction
if (mesh_.solutionD()[vector::X] != 1)
{ {
scalar thetai = piByTwo; FatalErrorIn("fvDOM::initialise()")
scalar deltaTheta = pi; << "Currently 1D solution is limited to the x-direction"
nRay_ = 2; << exit(FatalError);
IRay_.setSize(nRay_); }
scalar deltaPhi = pi;
label i = 0; scalar thetai = piByTwo;
for (label m = 1; m <= 2; m++) scalar deltaTheta = pi;
{ nRay_ = 2;
scalar phii = (2.0*m - 1.0)*deltaPhi/2.0; IRay_.setSize(nRay_);
IRay_.set scalar deltaPhi = pi;
label i = 0;
for (label m = 1; m <= 2; m++)
{
scalar phii = (2.0*m - 1.0)*deltaPhi/2.0;
IRay_.set
(
i,
new radiativeIntensityRay
( (
i, *this,
new radiativeIntensityRay mesh_,
( phii,
*this, thetai,
mesh_, deltaPhi,
phii, deltaTheta,
thetai, nLambda_,
deltaPhi, absorptionEmission_,
deltaTheta, blackBody_,
nLambda_, i
absorptionEmission_, )
blackBody_, );
i i++;
)
);
i++;
}
} }
} }
...@@ -388,6 +404,7 @@ Foam::radiation::fvDOM::fvDOM ...@@ -388,6 +404,7 @@ Foam::radiation::fvDOM::fvDOM
initialise(); initialise();
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::fvDOM::~fvDOM() Foam::radiation::fvDOM::~fvDOM()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment