Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2011-10-04 15:37:14 +01:00
22 changed files with 218 additions and 152 deletions

View File

@ -40,7 +40,7 @@ Foam::Field<Type> Foam::interpolateSplineXY
forAll(xNew, i)
{
yNew[i] = interpolateSmoothXY(xNew[i], xOld, yOld);
yNew[i] = interpolateSplineXY(xNew[i], xOld, yOld);
}
return yNew;

View File

@ -107,7 +107,7 @@ bool Foam::adjustPhi
{
massCorr = (massIn - fixedMassOut)/adjustableMassOut;
}
else if (mag(fixedMassOut - massIn)/totalFlux > 1e-10)
else if (mag(fixedMassOut - massIn)/totalFlux > 1e-8)
{
FatalErrorIn
(

View File

@ -114,20 +114,67 @@ void Foam::mappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(this->patch().patch());
const fvMesh& nbrMesh = refCast<const fvMesh>(mpp.sampleMesh());
const label samplePatchI = mpp.samplePolyPatch().index();
const fvPatch& nbrPatch = nbrMesh.boundary()[samplePatchI];
Field<Type> nbrIntFld;
// Retrieve the neighbour field
const fvPatchField<Type>& nbrField =
nbrPatch.template lookupPatchField<FieldType, Type>
(
this->dimensionedInternalField().name()
);
switch (mpp.mode())
{
case mappedPatchBase::NEARESTCELL:
{
FatalErrorIn
(
"void mappedFixedValueFvPatchField<Type>::updateCoeffs()"
) << "Cannot apply "
<< mappedPatchBase::sampleModeNames_
[
mappedPatchBase::NEARESTCELL
]
<< " mapping mode for patch " << this->patch().name()
<< exit(FatalError);
// Retrieve the neighbour patch internal field
Field<Type> nbrIntFld(nbrField.patchInternalField());
mpp.distribute(nbrIntFld);
break;
}
case mappedPatchBase::NEARESTPATCHFACE:
{
const label samplePatchI = mpp.samplePolyPatch().index();
const fvPatchField<Type>& nbrPatchField =
this->sampleField().boundaryField()[samplePatchI];
nbrIntFld = nbrPatchField.patchInternalField();
mpp.distribute(nbrIntFld);
break;
}
case mappedPatchBase::NEARESTFACE:
{
Field<Type> allValues(nbrMesh.nFaces(), pTraits<Type>::zero);
const FieldType& nbrField = this->sampleField();
forAll(nbrField.boundaryField(), patchI)
{
const fvPatchField<Type>& pf = nbrField.boundaryField()[patchI];
const Field<Type> pif(pf.patchInternalField());
label faceStart = pf.patch().start();
forAll(pf, faceI)
{
allValues[faceStart++] = pif[faceI];
}
}
mpp.distribute(allValues);
nbrIntFld.transfer(allValues);
break;
}
default:
{
FatalErrorIn("mappedFixedValueFvPatchField<Type>::updateCoeffs()")
<< "Unknown sampling mode: " << mpp.mode()
<< abort(FatalError);
}
}
// Restore tag
UPstream::msgType() = oldTag;

View File

@ -71,7 +71,10 @@ class mappedFixedValueFvPatchField
:
public fixedValueFvPatchField<Type>
{
// Private data
protected:
// Protected data
//- Name of field to sample - defaults to field associated with this
// patchField if not specified
@ -90,7 +93,7 @@ class mappedFixedValueFvPatchField
mutable autoPtr<interpolation<Type> > interpolator_;
// Private Member Functions
// Protected Member Functions
//- Field to sample. Either on my or nbr mesh
const GeometricField<Type, fvPatchField, volMesh>& sampleField() const;

View File

@ -146,9 +146,9 @@ public:
};
private:
protected:
// Private data
// Protected data
//- Patch to sample
const polyPatch& patch_;
@ -199,7 +199,7 @@ private:
dictionary surfDict_;
// Private Member Functions
// Protected Member Functions
//- Collect single list of samples and originating processor+face.
void collectSamples

View File

@ -3,9 +3,10 @@ sinclude $(RULES)/mplib$(WM_MPLIB)
EXE_INC = \
$(PFLAGS) $(PINC) \
-I$(SCOTCH_ROOT)/include \
-I$(SCOTCH_ARCH_PATH)/include/$(FOAM_MPI) \
-I/usr/include/scotch \
-I../decompositionMethods/lnInclude
LIB_LIBS = \
-L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) -lptscotch -lptscotcherrexit -lrt
-L$(SCOTCH_ROOT)/lib -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) -lptscotch -lptscotcherrexit -lrt

View File

@ -7,9 +7,10 @@ sinclude $(RULES)/mplib$(WM_MPLIB)
EXE_INC = \
$(PFLAGS) $(PINC) \
-I$(SCOTCH_ROOT)/include \
-I$(SCOTCH_ARCH_PATH)/include \
-I/usr/include/scotch \
-I../decompositionMethods/lnInclude
LIB_LIBS = \
-L$(FOAM_EXT_LIBBIN) -lscotch -lscotcherrexit -lrt
-L$(SCOTCH_ROOT)/lib -L$(FOAM_EXT_LIBBIN) -lscotch -lscotcherrexit -lrt

View File

@ -1,77 +1,77 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ 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 "kinematicSingleLayer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace regionModels
{
namespace surfaceFilmModels
{
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class Type>
void kinematicSingleLayer::constrainFilmField
(
Type& field,
const typename Type::cmptType& value
)
{
forAll(intCoupledPatchIDs_, i)
{
label patchI = intCoupledPatchIDs_[i];
field.boundaryField()[patchI] = value;
if (debug)
{
Info<< "Constraining " << field.name()
<< " boundary " << field.boundaryField()[patchI].patch().name()
<< " to " << value << endl;
}
}
forAll(passivePatchIDs_, i)
{
label patchI = passivePatchIDs_[i];
field.boundaryField()[patchI] = value;
if (debug)
{
Info<< "Constraining " << field.name()
<< " boundary " << field.boundaryField()[patchI].patch().name()
<< " to " << value << endl;
}
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // end namespace Foam
} // end namespace regionModels
} // end namespace surfaceFilmModels
// ************************************************************************* //
\\/ 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 "kinematicSingleLayer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace regionModels
{
namespace surfaceFilmModels
{
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class Type>
void kinematicSingleLayer::constrainFilmField
(
Type& field,
const typename Type::cmptType& value
)
{
forAll(intCoupledPatchIDs_, i)
{
label patchI = intCoupledPatchIDs_[i];
field.boundaryField()[patchI] = value;
if (debug)
{
Info<< "Constraining " << field.name()
<< " boundary " << field.boundaryField()[patchI].patch().name()
<< " to " << value << endl;
}
}
forAll(passivePatchIDs_, i)
{
label patchI = passivePatchIDs_[i];
field.boundaryField()[patchI] = value;
if (debug)
{
Info<< "Constraining " << field.name()
<< " boundary " << field.boundaryField()[patchI].patch().name()
<< " to " << value << endl;
}
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // end namespace Foam
} // end namespace regionModels
} // end namespace surfaceFilmModels
// ************************************************************************* //

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "nuSgsUSpaldingWallFunctionFvPatchScalarField.H"
#include "LESModel.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
@ -47,8 +48,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
)
:
fixedValueFvPatchScalarField(p, iF),
UName_("U"),
nuName_("nu"),
kappa_(0.41),
E_(9.8)
{}
@ -64,8 +63,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
)
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
UName_(ptf.UName_),
nuName_(ptf.nuName_),
kappa_(ptf.kappa_),
E_(ptf.E_)
{}
@ -80,8 +77,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
)
:
fixedValueFvPatchScalarField(p, iF, dict),
UName_(dict.lookupOrDefault<word>("U", "U")),
nuName_(dict.lookupOrDefault<word>("nu", "nu")),
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
E_(dict.lookupOrDefault<scalar>("E", 9.8))
{}
@ -94,8 +89,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
)
:
fixedValueFvPatchScalarField(nwfpsf),
UName_(nwfpsf.UName_),
nuName_(nwfpsf.nuName_),
kappa_(nwfpsf.kappa_),
E_(nwfpsf.E_)
{}
@ -109,8 +102,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
)
:
fixedValueFvPatchScalarField(nwfpsf, iF),
UName_(nwfpsf.UName_),
nuName_(nwfpsf.nuName_),
kappa_(nwfpsf.kappa_),
E_(nwfpsf.E_)
{}
@ -123,16 +114,15 @@ void nuSgsUSpaldingWallFunctionFvPatchScalarField::evaluate
const Pstream::commsTypes
)
{
const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
const label patchi = patch().index();
const fvPatchVectorField& U = lesModel.U().boundaryField()[patchi];
const scalarField nuw = lesModel.nu()().boundaryField()[patchi];
const scalarField& ry = patch().deltaCoeffs();
const fvPatchVectorField& U =
patch().lookupPatchField<volVectorField, vector>(UName_);
const scalarField magUp(mag(U.patchInternalField() - U));
const scalarField& nuw =
patch().lookupPatchField<volScalarField, scalar>(nuName_);
scalarField& nuSgsw = *this;
const scalarField magFaceGradU(mag(U.snGrad()));
@ -185,8 +175,6 @@ void nuSgsUSpaldingWallFunctionFvPatchScalarField::evaluate
void nuSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_);
writeEntryIfDifferent<word>(os, "nu", "nu", nuName_);
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
writeEntry("value", os);
@ -201,6 +189,7 @@ makePatchTypeField
nuSgsUSpaldingWallFunctionFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels

View File

@ -58,12 +58,6 @@ class nuSgsUSpaldingWallFunctionFvPatchScalarField
{
// Private data
//- Name of velocity field
word UName_;
//- Name of laminar viscosity field
word nuName_;
//- Von Karman constant
scalar kappa_;