Commit 5c805688 authored by Sergio Ferraris's avatar Sergio Ferraris
Browse files

STY: Reordering FvPathces and libs

parent f1685c92
......@@ -7,15 +7,18 @@ fvVectorMatrix UEqn
UEqn.relax();
solve
(
UEqn
==
fvc::reconstruct
if (pimple.momentumPredictor())
{
solve
(
UEqn
==
fvc::reconstruct
(
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
)*mesh.magSf()
)
);
(
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
)*mesh.magSf()
)
);
}
......@@ -16,4 +16,5 @@ EXE_LIBS = \
-lcompressibleRASModels \
-lfiniteVolume \
-lmeshTools \
-lthermoBaffleModels
-lthermoBaffleModels \
-lregionModels
turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C
externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
LIB = $(FOAM_LIBBIN)/libcoupledDerivedFvPatchFields
......@@ -202,7 +202,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
return;
}
if(oldMode_ == fixedHeatFlux)
if (oldMode_ == fixedHeatFlux)
{
this->refGrad() = q_/K(*this);
this->refValue() = 0.0;
......
......@@ -54,8 +54,6 @@ SourceFiles
#ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H
#define solidWallHeatFluxTemperatureFvPatchScalarField_H
//#include "fixedGradientFvPatchFields.H"
#include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H"
......
......@@ -21,7 +21,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
volScalarField& Yi = Y[i];
fvScalarMatrix R = combustion->R(Yi);
solve
fvScalarMatrix YiEqn
(
fvm::ddt(rho, Yi)
+ mvConvection->fvmDiv(phi, Yi)
......@@ -29,10 +29,12 @@ tmp<fv::convectionScheme<scalar> > mvConvection
==
parcels.SYi(i, Yi)
+ surfaceFilm.Srho(i)
+ R,
mesh.solver("Yi")
+ R
);
YiEqn.relax();
YiEqn.solve(mesh.solver("Yi"));
Yi.max(0.0);
Yt += Yi;
}
......
......@@ -25,7 +25,7 @@ Application
reactingParcelFilmPyrolysisFoam
Description
Transient PISO solver for compressible, laminar or turbulent flow with
Transient PIMPLE solver for Fires and turbulent diffusion flames with
reacting Lagrangian parcels, surface film and pyrolysis modelling.
\*---------------------------------------------------------------------------*/
......
......@@ -120,6 +120,7 @@ $(derivedFvPatchFields)/directMappedFixedInternalValue/directMappedFixedInternal
$(derivedFvPatchFields)/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
$(derivedFvPatchFields)/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C
$(derivedFvPatchFields)/fan/fanFvPatchFields.C
$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C
$(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
......
......@@ -23,20 +23,18 @@ License
\*---------------------------------------------------------------------------*/
#include "flowRateInletVelocityCoupledFvPatchVectorField.H"
#include "directMappedFlowRateFvPatchVectorField.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "directMappedPatchBase.H"
#include "mapDistribute.H"
#include "regionProperties.H"
#include "basicThermo.H"
#include "surfaceFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::flowRateInletVelocityCoupledFvPatchVectorField::
flowRateInletVelocityCoupledFvPatchVectorField
Foam::directMappedFlowRateFvPatchVectorField::
directMappedFlowRateFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF
......@@ -49,10 +47,10 @@ flowRateInletVelocityCoupledFvPatchVectorField
{}
Foam::flowRateInletVelocityCoupledFvPatchVectorField::
flowRateInletVelocityCoupledFvPatchVectorField
Foam::directMappedFlowRateFvPatchVectorField::
directMappedFlowRateFvPatchVectorField
(
const flowRateInletVelocityCoupledFvPatchVectorField& ptf,
const directMappedFlowRateFvPatchVectorField& ptf,
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper
......@@ -65,8 +63,8 @@ flowRateInletVelocityCoupledFvPatchVectorField
{}
Foam::flowRateInletVelocityCoupledFvPatchVectorField::
flowRateInletVelocityCoupledFvPatchVectorField
Foam::directMappedFlowRateFvPatchVectorField::
directMappedFlowRateFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
......@@ -80,10 +78,10 @@ flowRateInletVelocityCoupledFvPatchVectorField
{}
Foam::flowRateInletVelocityCoupledFvPatchVectorField::
flowRateInletVelocityCoupledFvPatchVectorField
Foam::directMappedFlowRateFvPatchVectorField::
directMappedFlowRateFvPatchVectorField
(
const flowRateInletVelocityCoupledFvPatchVectorField& ptf
const directMappedFlowRateFvPatchVectorField& ptf
)
:
fixedValueFvPatchField<vector>(ptf),
......@@ -93,10 +91,10 @@ flowRateInletVelocityCoupledFvPatchVectorField
{}
Foam::flowRateInletVelocityCoupledFvPatchVectorField::
flowRateInletVelocityCoupledFvPatchVectorField
Foam::directMappedFlowRateFvPatchVectorField::
directMappedFlowRateFvPatchVectorField
(
const flowRateInletVelocityCoupledFvPatchVectorField& ptf,
const directMappedFlowRateFvPatchVectorField& ptf,
const DimensionedField<vector, volMesh>& iF
)
:
......@@ -109,7 +107,7 @@ flowRateInletVelocityCoupledFvPatchVectorField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs()
void Foam::directMappedFlowRateFvPatchVectorField::updateCoeffs()
{
if (updated())
{
......@@ -127,35 +125,19 @@ void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs()
nbrMesh
).boundary()[mpp.samplePolyPatch().index()];
// Force recalculation of mapping and schedule
const mapDistribute& distMap = mpp.map();
scalarList phi =
nbrPatch.lookupPatchField<surfaceScalarField, scalar>(nbrPhiName_);
mapDistribute::distribute
(
Pstream::defaultCommsType,
distMap.schedule(),
distMap.constructSize(),
distMap.subMap(), // what to send
distMap.constructMap(), // what to receive
phi
);
mpp.map().distribute(phi);
const surfaceScalarField& phiName =
db().lookupObject<surfaceScalarField>(phiName_);
// a simpler way of doing this would be nice
//scalar avgU = -flowRate_/gSum(patch().magSf());
scalarField U = -phi/patch().magSf();
vectorField n = patch().nf();
// const surfaceScalarField& phi =
// db().lookupObject<surfaceScalarField>(phiName_);
if (phiName.dimensions() == dimVelocity*dimArea)
{
// volumetric flow-rate
......@@ -186,7 +168,7 @@ void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs()
{
FatalErrorIn
(
"flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs()"
"directMappedFlowRateFvPatchVectorField::updateCoeffs()"
) << "dimensions of " << phiName_ << " are incorrect" << nl
<< " on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
......@@ -198,7 +180,7 @@ void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs()
}
void Foam::flowRateInletVelocityCoupledFvPatchVectorField::write
void Foam::directMappedFlowRateFvPatchVectorField::write
(
Ostream& os
) const
......@@ -218,7 +200,7 @@ namespace Foam
makePatchTypeField
(
fvPatchVectorField,
flowRateInletVelocityCoupledFvPatchVectorField
directMappedFlowRateFvPatchVectorField
);
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2006-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::flowRateInletVelocityCoupledFvPatchVectorField
Foam::directMappedFlowRateFvPatchVectorField
Description
Describes a volumetric/mass flow normal vector boundary condition by its
......@@ -41,7 +41,7 @@ Description
@verbatim
inlet
{
type flowRateInletVelocityCoupled;
type directMappedFlowRate;
phi phi;
rho rho;
neigPhi neigPhiName_; // Volumetric/mass flow rate
......@@ -50,18 +50,13 @@ Description
}
@endverbatim
Note
- The value is positive inwards
- May not work correctly for transonic inlets
- Strange behaviour with potentialFoam since the U equation is not solved
SourceFiles
flowRateInletVelocityCoupledFvPatchVectorField.C
directMappedFlowRateFvPatchVectorField.C
\*---------------------------------------------------------------------------*/
#ifndef flowRateInletVelocityCoupledFvPatchVectorField_H
#define flowRateInletVelocityCoupledFvPatchVectorField_H
#ifndef directMappedFlowRateFvPatchVectorField_H
#define directMappedFlowRateFvPatchVectorField_H
#include "fixedValueFvPatchFields.H"
......@@ -73,7 +68,7 @@ namespace Foam
Class flowRateInletVelocityFvPatch Declaration
\*---------------------------------------------------------------------------*/
class flowRateInletVelocityCoupledFvPatchVectorField
class directMappedFlowRateFvPatchVectorField
:
public fixedValueFvPatchVectorField
{
......@@ -92,20 +87,20 @@ class flowRateInletVelocityCoupledFvPatchVectorField
public:
//- Runtime type information
TypeName("flowRateInletVelocityCoupled");
TypeName("directMappedFlowRate");
// Constructors
//- Construct from patch and internal field
flowRateInletVelocityCoupledFvPatchVectorField
directMappedFlowRateFvPatchVectorField
(
const fvPatch&,
const DimensionedField<vector, volMesh>&
);
//- Construct from patch, internal field and dictionary
flowRateInletVelocityCoupledFvPatchVectorField
directMappedFlowRateFvPatchVectorField
(
const fvPatch&,
const DimensionedField<vector, volMesh>&,
......@@ -113,20 +108,20 @@ public:
);
//- Construct by mapping given
// flowRateInletVelocityCoupledFvPatchVectorField
// directMappedFlowRateFvPatchVectorField
// onto a new patch
flowRateInletVelocityCoupledFvPatchVectorField
directMappedFlowRateFvPatchVectorField
(
const flowRateInletVelocityCoupledFvPatchVectorField&,
const directMappedFlowRateFvPatchVectorField&,
const fvPatch&,
const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
flowRateInletVelocityCoupledFvPatchVectorField
directMappedFlowRateFvPatchVectorField
(
const flowRateInletVelocityCoupledFvPatchVectorField&
const directMappedFlowRateFvPatchVectorField&
);
//- Construct and return a clone
......@@ -134,14 +129,14 @@ public:
{
return tmp<fvPatchVectorField>
(
new flowRateInletVelocityCoupledFvPatchVectorField(*this)
new directMappedFlowRateFvPatchVectorField(*this)
);
}
//- Construct as copy setting internal field reference
flowRateInletVelocityCoupledFvPatchVectorField
directMappedFlowRateFvPatchVectorField
(
const flowRateInletVelocityCoupledFvPatchVectorField&,
const directMappedFlowRateFvPatchVectorField&,
const DimensionedField<vector, volMesh>&
);
......@@ -153,7 +148,7 @@ public:
{
return tmp<fvPatchVectorField>
(
new flowRateInletVelocityCoupledFvPatchVectorField(*this, iF)
new directMappedFlowRateFvPatchVectorField(*this, iF)
);
}
......
/* derived patches */
derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2.C
derivedFvPatchFields/flowRateInletVelocityCoupled/flowRateInletVelocityCoupledFvPatchVectorField.C
derivedFvPatchFields/totalFlowRateAdvectiveDiffusiveFvPatchScalarField/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C
derivedFvPatchFields/turbulentTemperatureRadiativeCoupledMixed/turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField.C
/* Pyrolysis models */
pyrolysisModel/pyrolysisModel.C
pyrolysisModel/pyrolysisModelNew.C
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "directMappedPatchBase.H"
#include "mapDistribute.H"
#include "basicThermo.H"
#include "LESModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace LESModels
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2::
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(p, iF),
nbrFieldName_("undefined-nbrFieldName"),
KName_("undefined-K")
{
this->refValue() = 0.0;
this->refGrad() = 0.0;
this->valueFraction() = 1.0;
}
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2::
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2
(
const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
mixedFvPatchScalarField(ptf, p, iF, mapper),
nbrFieldName_(ptf.nbrFieldName_),
KName_(ptf.KName_)
{}
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2::
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
mixedFvPatchScalarField(p, iF),
nbrFieldName_(dict.lookup("nbrFieldName")),
KName_(dict.lookup("K"))
{
if (!isA<directMappedPatchBase>(this->patch().patch()))
{
FatalErrorIn
(
"turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2::"
"turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2\n"
"(\n"
" const fvPatch& p,\n"
" const DimensionedField<scalar, volMesh>& iF,\n"
" const dictionary& dict\n"
")\n"
) << "\n patch type '" << p.type()
<< "' not type '" << directMappedPatchBase::typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << dimensionedInternalField().name()
<< " in file " << dimensionedInternalField().objectPath()
<< exit(FatalError);
}
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
if (dict.found("refValue"))
{
// Full restart
refValue() = scalarField("refValue", dict, p.size());
refGrad() = scalarField("refGradient", dict, p.size());
valueFraction() = scalarField("valueFraction", dict, p.size());
}
else
{
// Start from user entered data. Assume fixedValue.
refValue() = *this;
refGrad() = 0.0;
valueFraction() = 1.0;
}
}
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2::
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2
(
const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2& wtcsf,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(wtcsf, iF),
nbrFieldName_(wtcsf.nbrFieldName_),
KName_(wtcsf.KName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<scalarField>
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2::K() const
{
const fvMesh& mesh = patch().boundaryMesh().mesh();
if (KName_ == "none")
{
const LESModel& model = db().lookupObject<LESModel>("LESProperties");
const basicThermo& thermo =
db().lookupObject<basicThermo>("thermophysicalProperties");
return
model.alphaEff()().boundaryField()[patch().index()]
*thermo.Cp()().boundaryField()[patch().index()];
}
else if (mesh.objectRegistry::foundObject<volScalarField>(KName_))
{
return patch().lookupPatchField<volScalarField, scalar>(KName_);
}
else if (mesh.objectRegistry::foundObject<volSymmTensorField>(KName_))
{