Skip to content

Commit

Permalink
BUG/ENH: Added use of engine time to cloud injection models - mantis …
Browse files Browse the repository at this point in the history
…#407
  • Loading branch information
andy committed Feb 2, 2012
1 parent e8ca073 commit 21430d6
Show file tree
Hide file tree
Showing 28 changed files with 558 additions and 157 deletions.
33 changes: 22 additions & 11 deletions src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.H
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -139,17 +139,28 @@ public:

// Member Functions

//- Return Table value
virtual Type value(const scalar x) const
{
return TableBase<Type>::value(x);
}
// Manipulation

//- Integrate between two (scalar) values
virtual Type integrate(const scalar x1, const scalar x2) const
{
return TableBase<Type>::integrate(x1, x2);
}
//- Convert time
virtual void convertTimeBase(const Time& t)
{
TableBase<Type>::convertTimeBase(t);
}


// Evaluation

//- Return Table value
virtual Type value(const scalar x) const
{
return TableBase<Type>::value(x);
}

//- Integrate between two (scalar) values
virtual Type integrate(const scalar x1, const scalar x2) const
{
return TableBase<Type>::integrate(x1, x2);
}


// I/O
Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand All @@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/

#include "DataEntry.H"
#include "Time.H"

// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //

Expand Down Expand Up @@ -59,6 +60,13 @@ const Foam::word& Foam::DataEntry<Type>::name() const
}


template<class Type>
void Foam::DataEntry<Type>::convertTimeBase(const Time&)
{
// do nothing
}


template<class Type>
Type Foam::DataEntry<Type>::value(const scalar x) const
{
Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -45,6 +45,7 @@ SourceFiles

namespace Foam
{
class Time;

template<class Type>
class DataEntry;
Expand Down Expand Up @@ -133,6 +134,12 @@ public:
const word& name() const;


// Manipulation

//- Convert time
virtual void convertTimeBase(const Time& t);


// Evaluation

//- Return value as a function of (scalar) independent variable
Expand Down
33 changes: 22 additions & 11 deletions src/OpenFOAM/primitives/functions/DataEntry/Table/Table.H
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -106,17 +106,28 @@ public:

// Member Functions

//- Return Table value
virtual Type value(const scalar x) const
{
return TableBase<Type>::value(x);
}
// Manipulation

//- Integrate between two (scalar) values
virtual Type integrate(const scalar x1, const scalar x2) const
{
return TableBase<Type>::integrate(x1, x2);
}
//- Convert time
virtual void convertTimeBase(const Time& t)
{
TableBase<Type>::convertTimeBase(t);
}


// Evaluation

//- Return Table value
virtual Type value(const scalar x) const
{
return TableBase<Type>::value(x);
}

//- Integrate between two (scalar) values
virtual Type integrate(const scalar x1, const scalar x2) const
{
return TableBase<Type>::integrate(x1, x2);
}


// I/O
Expand Down
14 changes: 13 additions & 1 deletion src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand All @@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/

#include "TableBase.H"
#include "Time.H"

// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

Expand Down Expand Up @@ -296,6 +297,17 @@ bool Foam::TableBase<Type>::checkMaxBounds
}


template<class Type>
void Foam::TableBase<Type>::convertTimeBase(const Time& t)
{
forAll(table_, i)
{
scalar value = table_[i].first();
table_[i].first() = t.userTimeToTime(value);
}
}


template<class Type>
Type Foam::TableBase<Type>::value(const scalar x) const
{
Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -129,6 +129,9 @@ public:
//- Check maximum table bounds
bool checkMaxBounds(const scalar x, scalar& xDash) const;

//- Convert time
virtual void convertTimeBase(const Time& t);

//- Return Table value
virtual Type value(const scalar x) const;

Expand Down
33 changes: 22 additions & 11 deletions src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.H
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -122,17 +122,28 @@ public:

// Member Functions

//- Return TableFile value
virtual Type value(const scalar x) const
{
return TableBase<Type>::value(x);
}
// Manipulation

//- Integrate between two (scalar) values
virtual Type integrate(const scalar x1, const scalar x2) const
{
return TableBase<Type>::integrate(x1, x2);
}
//- Convert time
virtual void convertTimeBase(const Time& t)
{
TableBase<Type>::convertTimeBase(t);
}


// Evaluation

//- Return TableFile value
virtual Type value(const scalar x) const
{
return TableBase<Type>::value(x);
}

//- Integrate between two (scalar) values
virtual Type integrate(const scalar x1, const scalar x2) const
{
return TableBase<Type>::integrate(x1, x2);
}


// I/O
Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand All @@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/

#include "polynomial.H"
#include "Time.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

Expand Down Expand Up @@ -89,6 +90,16 @@ Foam::polynomial::~polynomial()

// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

void Foam::polynomial::convertTimeBase(const Time& t)
{
forAll(coeffs_, i)
{
scalar value = coeffs_[i].first();
coeffs_[i].first() = t.userTimeToTime(value);
}
}


Foam::scalar Foam::polynomial::value(const scalar x) const
{
scalar y = 0.0;
Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -112,11 +112,19 @@ public:

// Member Functions

//- Return polynomial value
scalar value(const scalar x) const;
// Manipulation

//- Integrate between two (scalar) values
scalar integrate(const scalar x1, const scalar x2) const;
//- Convert time
virtual void convertTimeBase(const Time& t);


// Evaluation

//- Return polynomial value
scalar value(const scalar x) const;

//- Integrate between two (scalar) values
scalar integrate(const scalar x1, const scalar x2) const;


// I/O
Expand Down

0 comments on commit 21430d6

Please sign in to comment.