Replace tabs by 4 spaces in bin, tutorials, src, ... & clean-up by hand
This commit is contained in:
parent
4eb1b1f016
commit
82a0e1e7df
120 changed files with 1279 additions and 1226 deletions
|
@ -140,16 +140,22 @@ void engineTimeVaryingUniformFixedValueFvPatchField<symmTensor>::updateCoeffs()
|
||||||
template<>
|
template<>
|
||||||
void engineTimeVaryingUniformFixedValueFvPatchField<symmTensor4thOrder>::updateCoeffs()
|
void engineTimeVaryingUniformFixedValueFvPatchField<symmTensor4thOrder>::updateCoeffs()
|
||||||
{
|
{
|
||||||
notImplemented("engineTimeVaryingUniformFixedValueFvPatchField"
|
notImplemented
|
||||||
"<symmTensor4thOrder>::updateCoeffs()");
|
(
|
||||||
|
"engineTimeVaryingUniformFixedValueFvPatchField"
|
||||||
|
"<symmTensor4thOrder>::updateCoeffs()"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
void engineTimeVaryingUniformFixedValueFvPatchField<diagTensor>::updateCoeffs()
|
void engineTimeVaryingUniformFixedValueFvPatchField<diagTensor>::updateCoeffs()
|
||||||
{
|
{
|
||||||
notImplemented("engineTimeVaryingUniformFixedValueFvPatchField"
|
notImplemented
|
||||||
"<diagTensor>::updateCoeffs()");
|
(
|
||||||
|
"engineTimeVaryingUniformFixedValueFvPatchField"
|
||||||
|
"<diagTensor>::updateCoeffs()"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -84,11 +84,7 @@ void Foam::cyclicFaPatch::calcTransforms()
|
||||||
half0Normals[edgei] = point(1, 0, 0);
|
half0Normals[edgei] = point(1, 0, 0);
|
||||||
half1Normals[edgei] = half0Normals[edgei];
|
half1Normals[edgei] = half0Normals[edgei];
|
||||||
}
|
}
|
||||||
else if
|
else if(mag(magLe - nbrMagLe)/avLe > matchTol_())
|
||||||
(
|
|
||||||
mag(magLe - nbrMagLe)/avLe
|
|
||||||
> matchTol_()
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// Error in area matching. Find largest error
|
// Error in area matching. Find largest error
|
||||||
maxMatchError =
|
maxMatchError =
|
||||||
|
|
|
@ -234,8 +234,8 @@ skewCorrectedSnGrad<Type>::correction
|
||||||
(
|
(
|
||||||
min
|
min
|
||||||
(
|
(
|
||||||
limitCoeff_
|
limitCoeff_*
|
||||||
*mag
|
mag
|
||||||
(
|
(
|
||||||
uncorrectedSnGrad<Type>::snGrad
|
uncorrectedSnGrad<Type>::snGrad
|
||||||
(
|
(
|
||||||
|
|
|
@ -37,7 +37,10 @@ defineTypeNameAndDebug(leastSquaresVolPointInterpolation, 0);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void leastSquaresVolPointInterpolation::calcA(List<scalarSquareMatrix>& A) const
|
void leastSquaresVolPointInterpolation::calcA
|
||||||
|
(
|
||||||
|
List<scalarSquareMatrix>& A
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
//Info << "leastSquaresVolPointInterpolation calcA" << endl;
|
//Info << "leastSquaresVolPointInterpolation calcA" << endl;
|
||||||
|
|
||||||
|
@ -89,14 +92,17 @@ defineTypeNameAndDebug(leastSquaresVolPointInterpolation, 0);
|
||||||
//- for boundary points we will include the surrounding face centres
|
//- for boundary points we will include the surrounding face centres
|
||||||
forAll(mesh.boundary(), patchi)
|
forAll(mesh.boundary(), patchi)
|
||||||
{
|
{
|
||||||
const vectorField& faceCentres = mesh.boundaryMesh()[patchi].faceCentres();
|
const vectorField& faceCentres =
|
||||||
const labelListList& pointFaces = mesh.boundaryMesh()[patchi].pointFaces();
|
mesh.boundaryMesh()[patchi].faceCentres();
|
||||||
|
const labelListList& pointFaces =
|
||||||
|
mesh.boundaryMesh()[patchi].pointFaces();
|
||||||
|
|
||||||
if(mesh.boundary()[patchi].coupled()) //- for proc boundaries
|
if(mesh.boundary()[patchi].coupled()) //- for proc boundaries
|
||||||
{
|
{
|
||||||
//- for coupled patches we will use the values at the neighbourField cell centres and we will
|
//- for coupled patches we will use the values at the
|
||||||
//- not use the boundary face values
|
//- neighbourField cell centres and we will not use the boundary
|
||||||
//- neighbour cell centre are equal to the faceCell centres plus the delta vector
|
//- face values neighbour cell centre are equal to the faceCell
|
||||||
|
//- centres plus the delta vector
|
||||||
vectorField pDelta = mesh.boundary()[patchi].delta();
|
vectorField pDelta = mesh.boundary()[patchi].delta();
|
||||||
vectorField faceCellC(faceCentres.size(), vector::zero);
|
vectorField faceCellC(faceCentres.size(), vector::zero);
|
||||||
forAll(faceCentres, facei)
|
forAll(faceCentres, facei)
|
||||||
|
@ -115,7 +121,8 @@ defineTypeNameAndDebug(leastSquaresVolPointInterpolation, 0);
|
||||||
const scalar& y = neiCellC[neiCelli].component(vector::Y);
|
const scalar& y = neiCellC[neiCelli].component(vector::Y);
|
||||||
const scalar& z = neiCellC[neiCelli].component(vector::Z);
|
const scalar& z = neiCellC[neiCelli].component(vector::Z);
|
||||||
|
|
||||||
label globalPointi = mesh.boundaryMesh()[patchi].meshPoints()[pointi];
|
label globalPointi =
|
||||||
|
mesh.boundaryMesh()[patchi].meshPoints()[pointi];
|
||||||
|
|
||||||
A[globalPointi][0][0] += x*x;
|
A[globalPointi][0][0] += x*x;
|
||||||
A[globalPointi][0][1] += x*y;
|
A[globalPointi][0][1] += x*y;
|
||||||
|
@ -141,12 +148,14 @@ defineTypeNameAndDebug(leastSquaresVolPointInterpolation, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//- each point must use at least 4 neighbouring locations otherwise A is singular
|
//- each point must use at least 4 neighbouring locations otherwise
|
||||||
//- and simpleMatrix will cannot invert it
|
//- A is singular and simpleMatrix will cannot invert it therefore
|
||||||
//- therefore empty patches values are included to make sure A is not singular
|
//- empty patches values are included to make sure A is not
|
||||||
|
//- singular
|
||||||
forAll(pointFaces, pointi)
|
forAll(pointFaces, pointi)
|
||||||
{
|
{
|
||||||
label globalPointi = mesh.boundaryMesh()[patchi].meshPoints()[pointi];
|
label globalPointi =
|
||||||
|
mesh.boundaryMesh()[patchi].meshPoints()[pointi];
|
||||||
|
|
||||||
forAll(pointFaces[pointi], pointFacei)
|
forAll(pointFaces[pointi], pointFacei)
|
||||||
{
|
{
|
||||||
|
@ -182,7 +191,11 @@ defineTypeNameAndDebug(leastSquaresVolPointInterpolation, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void leastSquaresVolPointInterpolation::calcB(List<Field<vector> >& B, const GeometricField<vector, fvPatchField, volMesh>& vf) const
|
void leastSquaresVolPointInterpolation::calcB
|
||||||
|
(
|
||||||
|
List<Field<vector> >& B,
|
||||||
|
const GeometricField<vector, fvPatchField, volMesh>& vf
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
//Info << "leastSquaresVolPointInterpolation calcB" << endl;
|
//Info << "leastSquaresVolPointInterpolation calcB" << endl;
|
||||||
|
|
||||||
|
@ -204,7 +217,8 @@ defineTypeNameAndDebug(leastSquaresVolPointInterpolation, 0);
|
||||||
const scalar& y = mesh.C()[celli].component(vector::Y);
|
const scalar& y = mesh.C()[celli].component(vector::Y);
|
||||||
const scalar& z = mesh.C()[celli].component(vector::Z);
|
const scalar& z = mesh.C()[celli].component(vector::Z);
|
||||||
|
|
||||||
const scalar& phiCompi = vf.internalField()[celli].component(compi);
|
const scalar& phiCompi =
|
||||||
|
vf.internalField()[celli].component(compi);
|
||||||
|
|
||||||
B[pointi][0].component(compi) += phiCompi*x;
|
B[pointi][0].component(compi) += phiCompi*x;
|
||||||
B[pointi][1].component(compi) += phiCompi*y;
|
B[pointi][1].component(compi) += phiCompi*y;
|
||||||
|
@ -216,40 +230,52 @@ defineTypeNameAndDebug(leastSquaresVolPointInterpolation, 0);
|
||||||
//- for boundary points we will include the surrounding face centres
|
//- for boundary points we will include the surrounding face centres
|
||||||
forAll(mesh.boundary(), patchi)
|
forAll(mesh.boundary(), patchi)
|
||||||
{
|
{
|
||||||
const vectorField& faceCentres = mesh.boundaryMesh()[patchi].faceCentres();
|
const vectorField& faceCentres =
|
||||||
const labelListList& pointFaces = mesh.boundaryMesh()[patchi].pointFaces();
|
mesh.boundaryMesh()[patchi].faceCentres();
|
||||||
const labelList& faceCells = mesh.boundaryMesh()[patchi].faceCells();
|
const labelListList& pointFaces =
|
||||||
|
mesh.boundaryMesh()[patchi].pointFaces();
|
||||||
|
const labelList& faceCells =
|
||||||
|
mesh.boundaryMesh()[patchi].faceCells();
|
||||||
|
|
||||||
//- fix: do not calculate B for empty patches - philipc
|
//- fix: do not calculate B for empty patches - philipc
|
||||||
if(mesh.boundary()[patchi].coupled())
|
if(mesh.boundary()[patchi].coupled())
|
||||||
{
|
{
|
||||||
//- for coupled patches we will use the values at the neighbourField cell centres and we will
|
//- for coupled patches we will use the values at the
|
||||||
//- not use the boundary face values
|
//- neighbourField cell centres and we will not use the
|
||||||
//- neighbour cell centre are equal to the faceCell centres plus the delta vector
|
//- boundary face values neighbour cell centre are equal to
|
||||||
|
//- the faceCell centres plus the delta vector
|
||||||
vectorField pDelta = mesh.boundary()[patchi].delta();
|
vectorField pDelta = mesh.boundary()[patchi].delta();
|
||||||
vectorField faceCellC(faceCentres.size(), vector::zero);
|
vectorField faceCellC(faceCentres.size(), vector::zero);
|
||||||
forAll(faceCentres, facei)
|
forAll(faceCentres, facei)
|
||||||
{
|
{
|
||||||
label celli = mesh.boundaryMesh()[patchi].faceCells()[facei];
|
label celli =
|
||||||
|
mesh.boundaryMesh()[patchi].faceCells()[facei];
|
||||||
faceCellC[facei] = mesh.C()[celli];
|
faceCellC[facei] = mesh.C()[celli];
|
||||||
}
|
}
|
||||||
vectorField neiCellC = faceCellC + pDelta;
|
vectorField neiCellC = faceCellC + pDelta;
|
||||||
|
|
||||||
vectorField phiNeiField = vf.boundaryField()[patchi].patchNeighbourField();
|
vectorField phiNeiField =
|
||||||
|
vf.boundaryField()[patchi].patchNeighbourField();
|
||||||
|
|
||||||
forAll(pointFaces, pointi)
|
forAll(pointFaces, pointi)
|
||||||
{
|
{
|
||||||
forAll(pointFaces[pointi], pointFacei)
|
forAll(pointFaces[pointi], pointFacei)
|
||||||
{
|
{
|
||||||
label neiCelli = pointFaces[pointi][pointFacei];
|
label neiCelli = pointFaces[pointi][pointFacei];
|
||||||
const scalar& x = neiCellC[neiCelli].component(vector::X);
|
const scalar& x =
|
||||||
const scalar& y = neiCellC[neiCelli].component(vector::Y);
|
neiCellC[neiCelli].component(vector::X);
|
||||||
const scalar& z = neiCellC[neiCelli].component(vector::Z);
|
const scalar& y =
|
||||||
|
neiCellC[neiCelli].component(vector::Y);
|
||||||
|
const scalar& z =
|
||||||
|
neiCellC[neiCelli].component(vector::Z);
|
||||||
|
|
||||||
label globalPointi = mesh.boundaryMesh()[patchi].meshPoints()[pointi];
|
label globalPointi =
|
||||||
|
mesh.boundaryMesh()[patchi].meshPoints()[pointi];
|
||||||
|
|
||||||
//- this is the value of phi at the cell centre in the neighbour (i.e. across the interface)
|
//- this is the value of phi at the cell centre in the
|
||||||
scalar phiCompi = phiNeiField[neiCelli].component(compi);
|
//- neighbour (i.e. across the interface)
|
||||||
|
scalar phiCompi =
|
||||||
|
phiNeiField[neiCelli].component(compi);
|
||||||
|
|
||||||
B[globalPointi][0].component(compi) += phiCompi*x;
|
B[globalPointi][0].component(compi) += phiCompi*x;
|
||||||
B[globalPointi][1].component(compi) += phiCompi*y;
|
B[globalPointi][1].component(compi) += phiCompi*y;
|
||||||
|
@ -260,31 +286,39 @@ defineTypeNameAndDebug(leastSquaresVolPointInterpolation, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//- each point must use at least 4 neighbouring locations otherwise A is singular
|
//- each point must use at least 4 neighbouring locations
|
||||||
//- and simpleMatrix will cannot invert it
|
//- otherwise A is singular and simpleMatrix will cannot
|
||||||
//- therefore empty patches values are included to make sure A is not singular
|
//- make sure A is not singular invert it therefore empty
|
||||||
|
//- patches values are included to
|
||||||
forAll(pointFaces, pointi)
|
forAll(pointFaces, pointi)
|
||||||
{
|
{
|
||||||
forAll(pointFaces[pointi], pointFacei)
|
forAll(pointFaces[pointi], pointFacei)
|
||||||
{
|
{
|
||||||
//- fix: use pointFace not face philipc
|
//- fix: use pointFace not face philipc
|
||||||
label facei = pointFaces[pointi][pointFacei];
|
label facei = pointFaces[pointi][pointFacei];
|
||||||
const scalar& x = faceCentres[facei].component(vector::X);
|
const scalar& x =
|
||||||
const scalar& y = faceCentres[facei].component(vector::Y);
|
faceCentres[facei].component(vector::X);
|
||||||
const scalar& z = faceCentres[facei].component(vector::Z);
|
const scalar& y =
|
||||||
|
faceCentres[facei].component(vector::Y);
|
||||||
|
const scalar& z =
|
||||||
|
faceCentres[facei].component(vector::Z);
|
||||||
|
|
||||||
label globalPointi = mesh.boundaryMesh()[patchi].meshPoints()[pointi];
|
label globalPointi =
|
||||||
|
mesh.boundaryMesh()[patchi].meshPoints()[pointi];
|
||||||
|
|
||||||
scalar phiCompi = 0.0;
|
scalar phiCompi = 0.0;
|
||||||
if(mesh.boundary()[patchi].type() == "empty")
|
if(mesh.boundary()[patchi].type() == "empty")
|
||||||
{
|
{
|
||||||
//- use faceCell value for empty because empty patches do not store any values
|
//- use faceCell value for empty because empty
|
||||||
|
//- patches do not store any values
|
||||||
const label& ci = faceCells[facei];
|
const label& ci = faceCells[facei];
|
||||||
phiCompi = vf.internalField()[ci].component(compi);
|
phiCompi =
|
||||||
|
vf.internalField()[ci].component(compi);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
phiCompi = vf.boundaryField()[patchi][facei].component(compi);
|
phiCompi =
|
||||||
|
vf.boundaryField()[patchi][facei].component(compi);
|
||||||
}
|
}
|
||||||
|
|
||||||
B[globalPointi][0].component(compi) += phiCompi*x;
|
B[globalPointi][0].component(compi) += phiCompi*x;
|
||||||
|
@ -358,7 +392,10 @@ defineTypeNameAndDebug(leastSquaresVolPointInterpolation, 0);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
leastSquaresVolPointInterpolation::leastSquaresVolPointInterpolation(const fvMesh& vm)
|
leastSquaresVolPointInterpolation::leastSquaresVolPointInterpolation
|
||||||
|
(
|
||||||
|
const fvMesh& vm
|
||||||
|
)
|
||||||
:
|
:
|
||||||
MeshObject<fvMesh, leastSquaresVolPointInterpolation>(vm),
|
MeshObject<fvMesh, leastSquaresVolPointInterpolation>(vm),
|
||||||
mesh_(vm) //,
|
mesh_(vm) //,
|
||||||
|
|
|
@ -86,10 +86,17 @@ class leastSquaresVolPointInterpolation
|
||||||
void calcA(List<scalarSquareMatrix>& A) const;
|
void calcA(List<scalarSquareMatrix>& A) const;
|
||||||
|
|
||||||
//- calc B source for each point
|
//- calc B source for each point
|
||||||
void calcB(List<Field<vector> >& B, const GeometricField<vector, fvPatchField, volMesh>&) const;
|
void calcB
|
||||||
|
(
|
||||||
|
List<Field<vector> >& B,
|
||||||
|
const GeometricField<vector, fvPatchField, volMesh>&
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
leastSquaresVolPointInterpolation(const leastSquaresVolPointInterpolation&);
|
leastSquaresVolPointInterpolation
|
||||||
|
(
|
||||||
|
const leastSquaresVolPointInterpolation&
|
||||||
|
);
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const leastSquaresVolPointInterpolation&);
|
void operator=(const leastSquaresVolPointInterpolation&);
|
||||||
|
|
|
@ -306,14 +306,17 @@ inline DiagTensor<Cmpt> transform
|
||||||
const DiagTensor<Cmpt>& st
|
const DiagTensor<Cmpt>& st
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
notImplemented("transform.H\n"
|
notImplemented
|
||||||
|
(
|
||||||
|
"transform.H\n"
|
||||||
"template<>\n"
|
"template<>\n"
|
||||||
"inline DiagTensor<Cmpt> transform\n"
|
"inline DiagTensor<Cmpt> transform\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
"const tensor& tt,\n"
|
"const tensor& tt,\n"
|
||||||
"const DiagTensor<Cmpt>& st\n"
|
"const DiagTensor<Cmpt>& st\n"
|
||||||
")\n"
|
")\n"
|
||||||
"not implemented");
|
"not implemented"
|
||||||
|
);
|
||||||
|
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,5 +64,7 @@ boundaryField
|
||||||
{
|
{
|
||||||
type empty;
|
type empty;
|
||||||
}
|
}
|
||||||
} // ************************************************************************* //
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
FoamFile
|
FoamFile
|
||||||
{
|
{
|
||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii; ;
|
format ascii;
|
||||||
class dictionary; ;
|
class dictionary;
|
||||||
object decomposeParDict; ;
|
object decomposeParDict;
|
||||||
}
|
}
|
||||||
numberOfSubdomains 4;
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
FoamFile
|
FoamFile
|
||||||
{
|
{
|
||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii; ;
|
format ascii;
|
||||||
class dictionary; ;
|
class dictionary;
|
||||||
object decomposeParDict; ;
|
object decomposeParDict;
|
||||||
}
|
}
|
||||||
numberOfSubdomains 4;
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,7 @@ boundaryField
|
||||||
frictionCoeff 0.3;
|
frictionCoeff 0.3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
value uniform (0 0 0);
|
value uniform (0 0 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,7 @@ boundaryField
|
||||||
frictionCoeff 0.1;
|
frictionCoeff 0.1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
value uniform (0 0 0);
|
value uniform (0 0 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue