Skip to content

Commit

Permalink
ENH: Film models - added output of injected mass per patch
Browse files Browse the repository at this point in the history
  • Loading branch information
andy committed Nov 4, 2014
1 parent 6482bfa commit 25fc9b5
Show file tree
Hide file tree
Showing 16 changed files with 90 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -148,7 +148,7 @@ void pyrolysisModelCollection::evolve()
}


void pyrolysisModelCollection::info() const
void pyrolysisModelCollection::info()
{
forAll(*this, i)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -99,7 +99,7 @@ public:
virtual void evolve();

//- Provide some feedback from pyrolysis regions
virtual void info() const;
virtual void info();

//- Return max diffusivity allowed in the solid
virtual scalar maxDiff() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -729,7 +729,7 @@ void reactingOneDim::evolveRegion()
}


void reactingOneDim::info() const
void reactingOneDim::info()
{
Info<< "\nPyrolysis in region: " << regionMesh().name() << endl;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -285,7 +285,7 @@ public:
// I-O

//- Provide some feedback
virtual void info() const;
virtual void info();
};


Expand Down
2 changes: 1 addition & 1 deletion src/regionModels/regionModel/regionModel/regionModel.C
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ void Foam::regionModels::regionModel::postEvolveRegion()
}


void Foam::regionModels::regionModel::info() const
void Foam::regionModels::regionModel::info()
{
// do nothing
}
Expand Down
4 changes: 2 additions & 2 deletions src/regionModels/regionModel/regionModel/regionModel.H
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -343,7 +343,7 @@ public:
// I-O

//- Provide some feedback
virtual void info() const;
virtual void info();
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ const volScalarField& kinematicSingleLayer::cloudDiameterTrans() const
}


void kinematicSingleLayer::info() const
void kinematicSingleLayer::info()
{
Info<< "\nSurface film: " << type() << endl;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -525,7 +525,7 @@ public:
// I-O

//- Provide some feedback
virtual void info() const;
virtual void info();
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -61,7 +61,7 @@ protected:
// Protected data

//- Reference to the owner surface film model
const surfaceFilmModel& owner_;
surfaceFilmModel& owner_;


public:
Expand Down Expand Up @@ -103,9 +103,12 @@ public:
//- Flag to indicate when to write a property
virtual bool outputTime() const;

//- Return the reference to the owner surface film model
//- Return const access to the owner surface film model
inline const surfaceFilmModel& owner() const;

//- Return the reference to the owner surface film model
inline surfaceFilmModel& owner();

template<class FilmType>
inline const FilmType& filmType() const;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -40,6 +40,12 @@ inline const surfaceFilmModel& filmSubModelBase::owner() const
}


inline surfaceFilmModel& filmSubModelBase::owner()
{
return owner_;
}


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace surfaceFilmModels
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -39,8 +39,7 @@ namespace surfaceFilmModels
injectionModelList::injectionModelList(surfaceFilmModel& owner)
:
PtrList<injectionModel>(),
owner_(owner),
dict_(dictionary::null)
filmSubModelBase(owner)
{}


Expand All @@ -51,8 +50,15 @@ injectionModelList::injectionModelList
)
:
PtrList<injectionModel>(),
owner_(owner),
dict_(dict)
filmSubModelBase
(
"injectionModelList",
owner,
dict,
"injectionModelList",
"injectionModelList"
),
massInjected_(owner.intCoupledPatchIDs().size(), 0.0)
{
const wordList activeModels(dict.lookup("injectionModels"));

Expand All @@ -71,11 +77,7 @@ injectionModelList::injectionModelList
forAllConstIter(wordHashSet, models, iter)
{
const word& model = iter.key();
set
(
i,
injectionModel::New(owner, dict, model)
);
set(i, injectionModel::New(owner, dict, model));
i++;
}
}
Expand All @@ -91,6 +93,7 @@ injectionModelList::injectionModelList
injectionModelList::~injectionModelList()
{}


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

void injectionModelList::correct
Expand All @@ -110,10 +113,19 @@ void injectionModelList::correct
// Push values to boundaries ready for transfer to the primary region
massToInject.correctBoundaryConditions();
diameterToInject.correctBoundaryConditions();

const labelList& patchIDs = owner().intCoupledPatchIDs();

forAll(patchIDs, i)
{
label patchI = patchIDs[i];
massInjected_[i] =
massInjected_[i] + sum(massToInject.boundaryField()[patchI]);
}
}


void injectionModelList::info(Ostream& os) const
void injectionModelList::info(Ostream& os)
{
scalar injectedMass = 0.0;
forAll(*this, i)
Expand All @@ -123,6 +135,29 @@ void injectionModelList::info(Ostream& os) const
}

os << indent << "injected mass = " << injectedMass << nl;

scalarList mass0(massInjected_.size(), 0.0);
this->getModelProperty("massInjected", mass0);

scalarList mass(massInjected_);
Pstream::listCombineGather(mass, plusEqOp<scalar>());
mass = mass + mass0;

const polyBoundaryMesh& pbm = owner().regionMesh().boundaryMesh();
const labelList& patchIDs = owner().intCoupledPatchIDs();

forAll(patchIDs, i)
{
label patchI = patchIDs[i];
Info<< indent << " - patch: " << pbm[patchI].name() << ": "
<< mass[i] << endl;
}

if (owner().time().outputTime())
{
setModelProperty("massInjected", mass);
massInjected_ = 0.0;
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -37,6 +37,7 @@ SourceFiles

#include "PtrList.H"
#include "injectionModel.H"
#include "filmSubModelBase.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Expand All @@ -53,17 +54,15 @@ namespace surfaceFilmModels

class injectionModelList
:
public PtrList<injectionModel>
public PtrList<injectionModel>,
public filmSubModelBase
{
private:

// Private data

//- Reference to the owner surface film model
surfaceFilmModel& owner_;

//- Dictionary
dictionary dict_;
//- List of mass injected per patch
scalarField massInjected_;


// Private Member Functions
Expand Down Expand Up @@ -110,7 +109,7 @@ public:
// I-O

//- Provide some info
void info(Ostream& os) const;
virtual void info(Ostream& os);
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ tmp<volScalarField> thermoSingleLayer::primaryMassTrans() const
}


void thermoSingleLayer::info() const
void thermoSingleLayer::info()
{
kinematicSingleLayer::info();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -404,7 +404,7 @@ public:
// I-O

//- Provide some feedback
virtual void info() const;
virtual void info();
};


Expand Down
Loading

0 comments on commit 25fc9b5

Please sign in to comment.