mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -54,6 +54,7 @@ bool setCellFieldType
|
||||
|
||||
word fieldName(fieldValueStream);
|
||||
|
||||
// Check the current time directory
|
||||
IOobject fieldHeader
|
||||
(
|
||||
fieldName,
|
||||
@ -62,6 +63,18 @@ bool setCellFieldType
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
// Check the "constant" directory
|
||||
if (!fieldHeader.headerOk())
|
||||
{
|
||||
fieldHeader = IOobject
|
||||
(
|
||||
fieldName,
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
}
|
||||
|
||||
// Check field exists
|
||||
if (fieldHeader.headerOk())
|
||||
{
|
||||
@ -193,6 +206,7 @@ bool setFaceFieldType
|
||||
|
||||
word fieldName(fieldValueStream);
|
||||
|
||||
// Check the current time directory
|
||||
IOobject fieldHeader
|
||||
(
|
||||
fieldName,
|
||||
@ -201,6 +215,18 @@ bool setFaceFieldType
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
// Check the "constant" directory
|
||||
if (!fieldHeader.headerOk())
|
||||
{
|
||||
fieldHeader = IOobject
|
||||
(
|
||||
fieldName,
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
}
|
||||
|
||||
// Check field exists
|
||||
if (fieldHeader.headerOk())
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -343,6 +343,18 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::checkTable()
|
||||
)
|
||||
);
|
||||
|
||||
if (vals.size() != mapperPtr_().sourceSize())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeVaryingMappedFixedValueFvPatchField<Type>::"
|
||||
"checkTable()"
|
||||
) << "Number of values (" << vals.size()
|
||||
<< ") differs from the number of points ("
|
||||
<< mapperPtr_().sourceSize()
|
||||
<< ") in file " << vals.objectPath() << exit(FatalError);
|
||||
}
|
||||
|
||||
startAverage_ = vals.average();
|
||||
startSampledValues_ = mapperPtr_().interpolate(vals);
|
||||
}
|
||||
@ -388,6 +400,19 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::checkTable()
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
if (vals.size() != mapperPtr_().sourceSize())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeVaryingMappedFixedValueFvPatchField<Type>::"
|
||||
"checkTable()"
|
||||
) << "Number of values (" << vals.size()
|
||||
<< ") differs from the number of points ("
|
||||
<< mapperPtr_().sourceSize()
|
||||
<< ") in file " << vals.objectPath() << exit(FatalError);
|
||||
}
|
||||
|
||||
endAverage_ = vals.average();
|
||||
endSampledValues_ = mapperPtr_().interpolate(vals);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -70,8 +70,8 @@ Foam::linearUpwindV<Type>::correction
|
||||
const labelList& own = mesh.owner();
|
||||
const labelList& nei = mesh.neighbour();
|
||||
|
||||
const vectorField& C = mesh.C();
|
||||
const vectorField& Cf = mesh.Cf();
|
||||
const volVectorField& C = mesh.C();
|
||||
const surfaceVectorField& Cf = mesh.Cf();
|
||||
|
||||
tmp
|
||||
<
|
||||
@ -97,8 +97,7 @@ Foam::linearUpwindV<Type>::correction
|
||||
if (faceFlux[facei] > 0.0)
|
||||
{
|
||||
maxCorr =
|
||||
(1.0 - w[facei])
|
||||
*(vf[nei[facei]] - vf[own[facei]]);
|
||||
(1.0 - w[facei])*(vf[nei[facei]] - vf[own[facei]]);
|
||||
|
||||
sfCorr[facei] =
|
||||
(Cf[facei] - C[own[facei]]) & gradVf[own[facei]];
|
||||
@ -139,6 +138,86 @@ Foam::linearUpwindV<Type>::correction
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
typename GeometricField<Type, fvsPatchField, surfaceMesh>::
|
||||
GeometricBoundaryField& bSfCorr = sfCorr.boundaryField();
|
||||
|
||||
forAll(bSfCorr, patchi)
|
||||
{
|
||||
fvsPatchField<Type>& pSfCorr = bSfCorr[patchi];
|
||||
|
||||
if (pSfCorr.coupled())
|
||||
{
|
||||
const labelUList& pOwner =
|
||||
mesh.boundary()[patchi].faceCells();
|
||||
|
||||
const vectorField& pCf = Cf.boundaryField()[patchi];
|
||||
const scalarField& pW = w.boundaryField()[patchi];
|
||||
|
||||
const scalarField& pFaceFlux = faceFlux.boundaryField()[patchi];
|
||||
|
||||
const Field<typename outerProduct<vector, Type>::type> pGradVfNei
|
||||
(
|
||||
gradVf.boundaryField()[patchi].patchNeighbourField()
|
||||
);
|
||||
|
||||
const Field<Type> pVfNei
|
||||
(
|
||||
vf.boundaryField()[patchi].patchNeighbourField()
|
||||
);
|
||||
|
||||
// Build the d-vectors
|
||||
vectorField pd(Cf.boundaryField()[patchi].patch().delta());
|
||||
|
||||
forAll(pOwner, facei)
|
||||
{
|
||||
label own = pOwner[facei];
|
||||
|
||||
vector maxCorr;
|
||||
|
||||
if (pFaceFlux[facei] > 0)
|
||||
{
|
||||
pSfCorr[facei] = (pCf[facei] - C[own]) & gradVf[own];
|
||||
|
||||
maxCorr = (1.0 - pW[facei])*(pVfNei[facei] - vf[own]);
|
||||
}
|
||||
else
|
||||
{
|
||||
pSfCorr[facei] =
|
||||
(pCf[facei] - pd[facei] - C[own]) & pGradVfNei[facei];
|
||||
|
||||
maxCorr = pW[facei]*(vf[own] - pVfNei[facei]);
|
||||
}
|
||||
|
||||
scalar pSfCorrs = magSqr(pSfCorr[facei]);
|
||||
scalar maxCorrs = pSfCorr[facei] & maxCorr;
|
||||
|
||||
if (pSfCorrs > 0)
|
||||
{
|
||||
if (maxCorrs < 0)
|
||||
{
|
||||
pSfCorr[facei] = vector::zero;
|
||||
}
|
||||
else if (pSfCorrs > maxCorrs)
|
||||
{
|
||||
pSfCorr[facei] *= maxCorrs/(pSfCorrs + VSMALL);
|
||||
}
|
||||
}
|
||||
else if (pSfCorrs < 0)
|
||||
{
|
||||
if (maxCorrs > 0)
|
||||
{
|
||||
pSfCorr[facei] = vector::zero;
|
||||
}
|
||||
else if (pSfCorrs < maxCorrs)
|
||||
{
|
||||
pSfCorr[facei] *= maxCorrs/(pSfCorrs - VSMALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tsfCorr;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -313,6 +313,18 @@ void Foam::timeVaryingMappedFixedValuePointPatchField<Type>::checkTable()
|
||||
)
|
||||
);
|
||||
|
||||
if (vals.size() != mapperPtr_().sourceSize())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeVaryingMappedFixedValuePointPatchField<Type>::"
|
||||
"checkTable()"
|
||||
) << "Number of values (" << vals.size()
|
||||
<< ") differs from the number of points ("
|
||||
<< mapperPtr_().sourceSize()
|
||||
<< ") in file " << vals.objectPath() << exit(FatalError);
|
||||
}
|
||||
|
||||
startAverage_ = vals.average();
|
||||
startSampledValues_ = mapperPtr_().interpolate(vals);
|
||||
}
|
||||
@ -357,6 +369,19 @@ void Foam::timeVaryingMappedFixedValuePointPatchField<Type>::checkTable()
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
if (vals.size() != mapperPtr_().sourceSize())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"timeVaryingMappedFixedValuePointPatchField<Type>::"
|
||||
"checkTable()"
|
||||
) << "Number of values (" << vals.size()
|
||||
<< ") differs from the number of points ("
|
||||
<< mapperPtr_().sourceSize()
|
||||
<< ") in file " << vals.objectPath() << exit(FatalError);
|
||||
}
|
||||
|
||||
endAverage_ = vals.average();
|
||||
endSampledValues_ = mapperPtr_().interpolate(vals);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -239,7 +239,11 @@ void Foam::cyclicAMIPolyPatch::resetAMI() const
|
||||
AMIPtr_.clear();
|
||||
|
||||
const polyPatch& nbr = neighbPatch();
|
||||
pointField nbrPoints = neighbPatch().localPoints();
|
||||
pointField nbrPoints
|
||||
(
|
||||
neighbPatch().boundaryMesh().mesh().points(),
|
||||
neighbPatch().meshPoints()
|
||||
);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
@ -326,6 +330,9 @@ void Foam::cyclicAMIPolyPatch::initMovePoints
|
||||
)
|
||||
{
|
||||
polyPatch::initMovePoints(pBufs, p);
|
||||
|
||||
// See below. Clear out any local geometry
|
||||
primitivePatch::movePoints(p);
|
||||
}
|
||||
|
||||
|
||||
@ -339,6 +346,10 @@ void Foam::cyclicAMIPolyPatch::movePoints
|
||||
|
||||
calcTransforms();
|
||||
|
||||
// Note: resetAMI is called whilst in geometry update. So the slave
|
||||
// side might not have reached 'movePoints'. Is explicitly handled by
|
||||
// - clearing geometry of neighbour inside initMovePoints
|
||||
// - not using localPoints() inside resetAMI
|
||||
resetAMI();
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -222,7 +222,8 @@ Foam::pointToPointPlanarInterpolation::pointToPointPlanarInterpolation
|
||||
)
|
||||
:
|
||||
perturb_(perturb),
|
||||
referenceCS_(calcCoordinateSystem(sourcePoints))
|
||||
referenceCS_(calcCoordinateSystem(sourcePoints)),
|
||||
nPoints_(sourcePoints.size())
|
||||
|
||||
{
|
||||
calcWeights(sourcePoints, destPoints);
|
||||
@ -238,7 +239,8 @@ Foam::pointToPointPlanarInterpolation::pointToPointPlanarInterpolation
|
||||
)
|
||||
:
|
||||
perturb_(perturb),
|
||||
referenceCS_(referenceCS)
|
||||
referenceCS_(referenceCS),
|
||||
nPoints_(sourcePoints.size())
|
||||
{
|
||||
calcWeights(sourcePoints, destPoints);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -59,6 +59,9 @@ class pointToPointPlanarInterpolation
|
||||
//- Coordinate system
|
||||
coordinateSystem referenceCS_;
|
||||
|
||||
//- Number of source points (for checking)
|
||||
label nPoints_;
|
||||
|
||||
//- Current interpolation addressing to face centres of underlying
|
||||
// patch
|
||||
List<FixedList<label, 3> > nearestVertex_;
|
||||
@ -114,6 +117,12 @@ public:
|
||||
return referenceCS_;
|
||||
}
|
||||
|
||||
//- Number of source points
|
||||
label sourceSize() const
|
||||
{
|
||||
return nPoints_;
|
||||
}
|
||||
|
||||
// patch
|
||||
const List<FixedList<label, 3> >& nearestVertex() const
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,6 +33,17 @@ Foam::tmp<Foam::Field<Type> > Foam::pointToPointPlanarInterpolation::interpolate
|
||||
const Field<Type>& sourceFld
|
||||
) const
|
||||
{
|
||||
if (nPoints_ != sourceFld.size())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"pointToPointPlanarInterpolation::interpolate"
|
||||
"(const Field<Type>&) const"
|
||||
) << "Number of source points = " << nPoints_
|
||||
<< " number of values = " << sourceFld.size()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
tmp<Field<Type> > tfld(new Field<Type>(nearestVertex_.size()));
|
||||
Field<Type>& fld = tfld();
|
||||
|
||||
|
||||
@ -33,11 +33,17 @@ filter1
|
||||
|
||||
coordinateSystem
|
||||
{
|
||||
type cartesian;
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
{
|
||||
type axesRotation;
|
||||
e1 (1 0 0);
|
||||
e2 (0 1 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user