mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
rotorDiskSource: Debugged the duplicated interpolation functions
Needs rewriting to avoid unnecessary code duplication, preferably using standard OpenFOAM interpolation functionality.
This commit is contained in:
@ -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-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -29,7 +29,6 @@ License
|
|||||||
#include "vector.H"
|
#include "vector.H"
|
||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::bladeModel::readFromFile() const
|
bool Foam::bladeModel::readFromFile() const
|
||||||
@ -58,12 +57,18 @@ void Foam::bladeModel::interpolateWeights
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while ((values[i2] < xIn) && (i2 < nElem))
|
while ((i2 < nElem) && (values[i2] < xIn))
|
||||||
{
|
{
|
||||||
i2++;
|
i2++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i2 == nElem)
|
if (i2 == 0)
|
||||||
|
{
|
||||||
|
i1 = i2;
|
||||||
|
ddx = 0.0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (i2 == nElem)
|
||||||
{
|
{
|
||||||
i2 = nElem - 1;
|
i2 = nElem - 1;
|
||||||
i1 = i2;
|
i1 = i2;
|
||||||
@ -101,7 +106,6 @@ Foam::bladeModel::bladeModel(const dictionary& dict)
|
|||||||
dict.lookup("data") >> data;
|
dict.lookup("data") >> data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (data.size() > 0)
|
if (data.size() > 0)
|
||||||
{
|
{
|
||||||
profileName_.setSize(data.size());
|
profileName_.setSize(data.size());
|
||||||
|
|||||||
@ -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-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -60,12 +60,18 @@ void Foam::lookupProfile::interpolateWeights
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while ((values[i2] < xIn) && (i2 < nElem))
|
while ((i2 < nElem) && (values[i2] < xIn))
|
||||||
{
|
{
|
||||||
i2++;
|
i2++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i2 == nElem)
|
if (i2 == 0)
|
||||||
|
{
|
||||||
|
i1 = i2;
|
||||||
|
ddx = 0.0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (i2 == nElem)
|
||||||
{
|
{
|
||||||
i2 = nElem - 1;
|
i2 = nElem - 1;
|
||||||
i1 = i2;
|
i1 = i2;
|
||||||
|
|||||||
@ -64,8 +64,8 @@ disk
|
|||||||
{
|
{
|
||||||
data
|
data
|
||||||
(
|
(
|
||||||
(profile1 (0.1 -6 0.1))
|
(profile1 (0.1 -6 0.02))
|
||||||
(profile1 (0.25 -6 0.1))
|
(profile1 (0.25 -6 0.02))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user