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 ...@@ -7,15 +7,18 @@ fvVectorMatrix UEqn
UEqn.relax(); UEqn.relax();
solve if (pimple.momentumPredictor())
( {
UEqn solve
==
fvc::reconstruct
( (
UEqn
==
fvc::reconstruct
( (
- ghf*fvc::snGrad(rho) (
- fvc::snGrad(p_rgh) - ghf*fvc::snGrad(rho)
)*mesh.magSf() - fvc::snGrad(p_rgh)
) )*mesh.magSf()
); )
);
}
...@@ -16,4 +16,5 @@ EXE_LIBS = \ ...@@ -16,4 +16,5 @@ EXE_LIBS = \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lthermoBaffleModels -lthermoBaffleModels \
-lregionModels
turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C
externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
LIB = $(FOAM_LIBBIN)/libcoupledDerivedFvPatchFields LIB = $(FOAM_LIBBIN)/libcoupledDerivedFvPatchFields
...@@ -202,7 +202,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() ...@@ -202,7 +202,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
return; return;
} }
if(oldMode_ == fixedHeatFlux) if (oldMode_ == fixedHeatFlux)
{ {
this->refGrad() = q_/K(*this); this->refGrad() = q_/K(*this);
this->refValue() = 0.0; this->refValue() = 0.0;
......
...@@ -54,8 +54,6 @@ SourceFiles ...@@ -54,8 +54,6 @@ SourceFiles
#ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H #ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H
#define solidWallHeatFluxTemperatureFvPatchScalarField_H #define solidWallHeatFluxTemperatureFvPatchScalarField_H
//#include "fixedGradientFvPatchFields.H"
#include "mixedFvPatchFields.H" #include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H" #include "temperatureCoupledBase.H"
......
...@@ -21,7 +21,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection ...@@ -21,7 +21,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
volScalarField& Yi = Y[i]; volScalarField& Yi = Y[i];
fvScalarMatrix R = combustion->R(Yi); fvScalarMatrix R = combustion->R(Yi);
solve fvScalarMatrix YiEqn
( (
fvm::ddt(rho, Yi) fvm::ddt(rho, Yi)
+ mvConvection->fvmDiv(phi, Yi) + mvConvection->fvmDiv(phi, Yi)
...@@ -29,10 +29,12 @@ tmp<fv::convectionScheme<scalar> > mvConvection ...@@ -29,10 +29,12 @@ tmp<fv::convectionScheme<scalar> > mvConvection
== ==
parcels.SYi(i, Yi) parcels.SYi(i, Yi)
+ surfaceFilm.Srho(i) + surfaceFilm.Srho(i)
+ R, + R
mesh.solver("Yi")
); );
YiEqn.relax();
YiEqn.solve(mesh.solver("Yi"));
Yi.max(0.0); Yi.max(0.0);
Yt += Yi; Yt += Yi;
} }
......
...@@ -25,7 +25,7 @@ Application ...@@ -25,7 +25,7 @@ Application
reactingParcelFilmPyrolysisFoam reactingParcelFilmPyrolysisFoam
Description 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. reacting Lagrangian parcels, surface film and pyrolysis modelling.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
......
...@@ -120,6 +120,7 @@ $(derivedFvPatchFields)/directMappedFixedInternalValue/directMappedFixedInternal ...@@ -120,6 +120,7 @@ $(derivedFvPatchFields)/directMappedFixedInternalValue/directMappedFixedInternal
$(derivedFvPatchFields)/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C $(derivedFvPatchFields)/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFields.C $(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C $(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
$(derivedFvPatchFields)/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C
$(derivedFvPatchFields)/fan/fanFvPatchFields.C $(derivedFvPatchFields)/fan/fanFvPatchFields.C
$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C $(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C
$(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
......
...@@ -23,20 +23,18 @@ License ...@@ -23,20 +23,18 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "flowRateInletVelocityCoupledFvPatchVectorField.H" #include "directMappedFlowRateFvPatchVectorField.H"
#include "volFields.H" #include "volFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H" #include "fvPatchFieldMapper.H"
#include "directMappedPatchBase.H" #include "directMappedPatchBase.H"
#include "mapDistribute.H" #include "mapDistribute.H"
#include "regionProperties.H"
#include "basicThermo.H"
#include "surfaceFields.H" #include "surfaceFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::flowRateInletVelocityCoupledFvPatchVectorField:: Foam::directMappedFlowRateFvPatchVectorField::
flowRateInletVelocityCoupledFvPatchVectorField directMappedFlowRateFvPatchVectorField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<vector, volMesh>& iF const DimensionedField<vector, volMesh>& iF
...@@ -49,10 +47,10 @@ flowRateInletVelocityCoupledFvPatchVectorField ...@@ -49,10 +47,10 @@ flowRateInletVelocityCoupledFvPatchVectorField
{} {}
Foam::flowRateInletVelocityCoupledFvPatchVectorField:: Foam::directMappedFlowRateFvPatchVectorField::
flowRateInletVelocityCoupledFvPatchVectorField directMappedFlowRateFvPatchVectorField
( (
const flowRateInletVelocityCoupledFvPatchVectorField& ptf, const directMappedFlowRateFvPatchVectorField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<vector, volMesh>& iF, const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper const fvPatchFieldMapper& mapper
...@@ -65,8 +63,8 @@ flowRateInletVelocityCoupledFvPatchVectorField ...@@ -65,8 +63,8 @@ flowRateInletVelocityCoupledFvPatchVectorField
{} {}
Foam::flowRateInletVelocityCoupledFvPatchVectorField:: Foam::directMappedFlowRateFvPatchVectorField::
flowRateInletVelocityCoupledFvPatchVectorField directMappedFlowRateFvPatchVectorField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<vector, volMesh>& iF, const DimensionedField<vector, volMesh>& iF,
...@@ -80,10 +78,10 @@ flowRateInletVelocityCoupledFvPatchVectorField ...@@ -80,10 +78,10 @@ flowRateInletVelocityCoupledFvPatchVectorField
{} {}
Foam::flowRateInletVelocityCoupledFvPatchVectorField:: Foam::directMappedFlowRateFvPatchVectorField::
flowRateInletVelocityCoupledFvPatchVectorField directMappedFlowRateFvPatchVectorField
( (
const flowRateInletVelocityCoupledFvPatchVectorField& ptf const directMappedFlowRateFvPatchVectorField& ptf
) )
: :
fixedValueFvPatchField<vector>(ptf), fixedValueFvPatchField<vector>(ptf),
...@@ -93,10 +91,10 @@ flowRateInletVelocityCoupledFvPatchVectorField ...@@ -93,10 +91,10 @@ flowRateInletVelocityCoupledFvPatchVectorField
{} {}
Foam::flowRateInletVelocityCoupledFvPatchVectorField:: Foam::directMappedFlowRateFvPatchVectorField::
flowRateInletVelocityCoupledFvPatchVectorField directMappedFlowRateFvPatchVectorField
( (
const flowRateInletVelocityCoupledFvPatchVectorField& ptf, const directMappedFlowRateFvPatchVectorField& ptf,
const DimensionedField<vector, volMesh>& iF const DimensionedField<vector, volMesh>& iF
) )
: :
...@@ -109,7 +107,7 @@ flowRateInletVelocityCoupledFvPatchVectorField ...@@ -109,7 +107,7 @@ flowRateInletVelocityCoupledFvPatchVectorField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs() void Foam::directMappedFlowRateFvPatchVectorField::updateCoeffs()
{ {
if (updated()) if (updated())
{ {
...@@ -127,35 +125,19 @@ void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs() ...@@ -127,35 +125,19 @@ void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs()
nbrMesh nbrMesh
).boundary()[mpp.samplePolyPatch().index()]; ).boundary()[mpp.samplePolyPatch().index()];
// Force recalculation of mapping and schedule
const mapDistribute& distMap = mpp.map();
scalarList phi = scalarList phi =
nbrPatch.lookupPatchField<surfaceScalarField, scalar>(nbrPhiName_); nbrPatch.lookupPatchField<surfaceScalarField, scalar>(nbrPhiName_);
mapDistribute::distribute mpp.map().distribute(phi);
(
Pstream::defaultCommsType,
distMap.schedule(),
distMap.constructSize(),
distMap.subMap(), // what to send
distMap.constructMap(), // what to receive
phi
);
const surfaceScalarField& phiName = const surfaceScalarField& phiName =
db().lookupObject<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(); scalarField U = -phi/patch().magSf();
vectorField n = patch().nf(); vectorField n = patch().nf();
// const surfaceScalarField& phi =
// db().lookupObject<surfaceScalarField>(phiName_);
if (phiName.dimensions() == dimVelocity*dimArea) if (phiName.dimensions() == dimVelocity*dimArea)
{ {
// volumetric flow-rate // volumetric flow-rate
...@@ -186,7 +168,7 @@ void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs() ...@@ -186,7 +168,7 @@ void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs()
{ {
FatalErrorIn FatalErrorIn
( (
"flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs()" "directMappedFlowRateFvPatchVectorField::updateCoeffs()"
) << "dimensions of " << phiName_ << " are incorrect" << nl ) << "dimensions of " << phiName_ << " are incorrect" << nl
<< " on patch " << this->patch().name() << " on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name() << " of field " << this->dimensionedInternalField().name()
...@@ -198,7 +180,7 @@ void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs() ...@@ -198,7 +180,7 @@ void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs()
} }
void Foam::flowRateInletVelocityCoupledFvPatchVectorField::write void Foam::directMappedFlowRateFvPatchVectorField::write
( (
Ostream& os Ostream& os
) const ) const
...@@ -218,7 +200,7 @@ namespace Foam ...@@ -218,7 +200,7 @@ namespace Foam
makePatchTypeField makePatchTypeField
( (
fvPatchVectorField, fvPatchVectorField,
flowRateInletVelocityCoupledFvPatchVectorField directMappedFlowRateFvPatchVectorField
); );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -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) 2006-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -22,7 +22,7 @@ License ...@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::flowRateInletVelocityCoupledFvPatchVectorField Foam::directMappedFlowRateFvPatchVectorField
Description Description
Describes a volumetric/mass flow normal vector boundary condition by its Describes a volumetric/mass flow normal vector boundary condition by its
...@@ -41,7 +41,7 @@ Description ...@@ -41,7 +41,7 @@ Description
@verbatim @verbatim
inlet inlet
{ {
type flowRateInletVelocityCoupled; type directMappedFlowRate;
phi phi; phi phi;
rho rho; rho rho;
neigPhi neigPhiName_; // Volumetric/mass flow rate neigPhi neigPhiName_; // Volumetric/mass flow rate
...@@ -50,18 +50,13 @@ Description ...@@ -50,18 +50,13 @@ Description
} }
@endverbatim @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 SourceFiles
flowRateInletVelocityCoupledFvPatchVectorField.C directMappedFlowRateFvPatchVectorField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef flowRateInletVelocityCoupledFvPatchVectorField_H #ifndef directMappedFlowRateFvPatchVectorField_H
#define flowRateInletVelocityCoupledFvPatchVectorField_H #define directMappedFlowRateFvPatchVectorField_H
#include "fixedValueFvPatchFields.H" #include "fixedValueFvPatchFields.H"
...@@ -73,7 +68,7 @@ namespace Foam ...@@ -73,7 +68,7 @@ namespace Foam
Class flowRateInletVelocityFvPatch Declaration Class flowRateInletVelocityFvPatch Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class flowRateInletVelocityCoupledFvPatchVectorField class directMappedFlowRateFvPatchVectorField
: :
public fixedValueFvPatchVectorField public fixedValueFvPatchVectorField
{ {
...@@ -92,20 +87,20 @@ class flowRateInletVelocityCoupledFvPatchVectorField ...@@ -92,20 +87,20 @@ class flowRateInletVelocityCoupledFvPatchVectorField
public: public:
//- Runtime type information //- Runtime type information
TypeName("flowRateInletVelocityCoupled"); TypeName("directMappedFlowRate");
// Constructors // Constructors
//- Construct from patch and internal field //- Construct from patch and internal field
flowRateInletVelocityCoupledFvPatchVectorField directMappedFlowRateFvPatchVectorField
( (
const fvPatch&, const fvPatch&,
const DimensionedField<vector, volMesh>& const DimensionedField<vector, volMesh>&
); );
//- Construct from patch, internal field and dictionary //- Construct from patch, internal field and dictionary
flowRateInletVelocityCoupledFvPatchVectorField directMappedFlowRateFvPatchVectorField
( (
const fvPatch&, const fvPatch&,
const DimensionedField<vector, volMesh>&, const DimensionedField<vector, volMesh>&,
...@@ -113,20 +108,20 @@ public: ...@@ -113,20 +108,20 @@ public:
); );
//- Construct by mapping given //- Construct by mapping given
// flowRateInletVelocityCoupledFvPatchVectorField // directMappedFlowRateFvPatchVectorField
// onto a new patch // onto a new patch
flowRateInletVelocityCoupledFvPatchVectorField directMappedFlowRateFvPatchVectorField
( (
const flowRateInletVelocityCoupledFvPatchVectorField&, const directMappedFlowRateFvPatchVectorField&,
const fvPatch&, const fvPatch&,
const DimensionedField<vector, volMesh>&, const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper& const fvPatchFieldMapper&
); );
//- Construct as copy //- Construct as copy
flowRateInletVelocityCoupledFvPatchVectorField directMappedFlowRateFvPatchVectorField
( (
const flowRateInletVelocityCoupledFvPatchVectorField& const directMappedFlowRateFvPatchVectorField&
); );
//- Construct and return a clone //- Construct and return a clone
...@@ -134,14 +129,14 @@ public: ...@@ -134,14 +129,14 @@ public:
{ {
return tmp<fvPatchVectorField> return tmp<fvPatchVectorField>
( (
new flowRateInletVelocityCoupledFvPatchVectorField(*this) new directMappedFlowRateFvPatchVectorField(*this)
); );
} }
//- Construct as copy setting internal field reference //- Construct as copy setting internal field reference
flowRateInletVelocityCoupledFvPatchVectorField directMappedFlowRateFvPatchVectorField
( (
const flowRateInletVelocityCoupledFvPatchVectorField&, const directMappedFlowRateFvPatchVectorField&,
const DimensionedField<vector, volMesh>& const DimensionedField<vector, volMesh>&
); );
...@@ -153,7 +148,7 @@ public: ...@@ -153,7 +148,7 @@ public:
{ {
return tmp<fvPatchVectorField> 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 */ /* Pyrolysis models */
pyrolysisModel/pyrolysisModel.C pyrolysisModel/pyrolysisModel.C
pyrolysisModel/pyrolysisModelNew.C pyrolysisModel/pyrolysisModelNew.C
......