Commit c1268eb0 authored by andy's avatar andy Committed by Andrew Heather
Browse files

ENH: Film models - added output of injected mass per patch

parent 7816177c
......@@ -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
......@@ -148,7 +148,7 @@ void pyrolysisModelCollection::evolve()
}
void pyrolysisModelCollection::info() const
void pyrolysisModelCollection::info()
{
forAll(*this, i)
{
......
......@@ -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
......@@ -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;
......
......@@ -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
......@@ -729,7 +729,7 @@ void reactingOneDim::evolveRegion()
}
void reactingOneDim::info() const
void reactingOneDim::info()
{
Info<< "\nPyrolysis in region: " << regionMesh().name() << endl;
......
......@@ -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
......@@ -285,7 +285,7 @@ public:
// I-O
//- Provide some feedback
virtual void info() const;
virtual void info();
};
......
......@@ -579,7 +579,7 @@ void Foam::regionModels::regionModel::postEvolveRegion()
}
void Foam::regionModels::regionModel::info() const
void Foam::regionModels::regionModel::info()
{
// do nothing
}
......
......@@ -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
......@@ -343,7 +343,7 @@ public:
// I-O
//- Provide some feedback
virtual void info() const;
virtual void info();
};
......
......@@ -1074,7 +1074,7 @@ const volScalarField& kinematicSingleLayer::cloudDiameterTrans() const
}
void kinematicSingleLayer::info() const
void kinematicSingleLayer::info()
{
Info<< "\nSurface film: " << type() << endl;
......
......@@ -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
......@@ -525,7 +525,7 @@ public:
// I-O
//- Provide some feedback
virtual void info() const;
virtual void info();
};
......
......@@ -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
......@@ -61,7 +61,7 @@ protected:
// Protected data
//- Reference to the owner surface film model
const surfaceFilmModel& owner_;
surfaceFilmModel& owner_;
public:
......@@ -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;
};
......
......@@ -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
......@@ -40,6 +40,12 @@ inline const surfaceFilmModel& filmSubModelBase::owner() const
}
inline surfaceFilmModel& filmSubModelBase::owner()
{
return owner_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
......
......@@ -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
......@@ -39,8 +39,7 @@ namespace surfaceFilmModels
injectionModelList::injectionModelList(surfaceFilmModel& owner)
:
PtrList<injectionModel>(),
owner_(owner),
dict_(dictionary::null)
filmSubModelBase(owner)
{}
......@@ -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"));
......@@ -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++;
}
}
......@@ -91,6 +93,7 @@ injectionModelList::injectionModelList
injectionModelList::~injectionModelList()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void injectionModelList::correct
......@@ -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)
......@@ -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;
}
}
......
......@@ -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
......@@ -37,6 +37,7 @@ SourceFiles
#include "PtrList.H"
#include "injectionModel.H"
#include "filmSubModelBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -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
......@@ -110,7 +109,7 @@ public:
// I-O
//- Provide some info
void info(Ostream& os) const;
virtual void info(Ostream& os);
};
......
......@@ -730,7 +730,7 @@ tmp<volScalarField> thermoSingleLayer::primaryMassTrans() const
}
void thermoSingleLayer::info() const
void thermoSingleLayer::info()
{
kinematicSingleLayer::info();
......
......@@ -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
......@@ -404,7 +404,7 @@ public:
// I-O
//- Provide some feedback
virtual void info() const;
virtual void info();
};
......
......@@ -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
......@@ -107,13 +107,13 @@ void thermalBaffle::solveEnergy()
forAll(ppCoupled, localFaceI)
{
const labelList& cells = boundaryFaceCells_[localFaceI];
forAll (cells, i)
forAll(cells, i)
{
const label cellId = cells[i];
Q[cellId] =
Qs_.boundaryField()[patchI][localFaceI]
/thickness_[localFaceI];
/thickness_[localFaceI];
rho[cellId] *= delta_.value()/thickness_[localFaceI];
......@@ -352,7 +352,7 @@ const solidThermo& thermalBaffle::thermo() const
}
void thermalBaffle::info() const
void thermalBaffle::info()
{
const labelList& coupledPatches = intCoupledPatchIDs();
......@@ -361,7 +361,7 @@ void thermalBaffle::info() const
const label patchI = coupledPatches[i];
const fvPatchScalarField& ph = h_.boundaryField()[patchI];
const word patchName = regionMesh().boundary()[patchI].name();
Info << indent << "Q : " << patchName << indent <<
Info<< indent << "Q : " << patchName << indent <<
gSum
(
mag(regionMesh().Sf().boundaryField()[patchI])
......
......@@ -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
......@@ -199,7 +199,7 @@ public:
// I-O
//- Provide some feedback
virtual void info() const;
virtual void info();
};
......
Supports Markdown
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