Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry 2012-09-20 15:13:57 +01:00
commit c03dd363ed
52 changed files with 538 additions and 310 deletions

View File

@ -1,3 +1,6 @@
Test-DataEntry.C
interpolationWeights.C
splineInterpolationWeights.C
linearInterpolationWeights.C
EXE = $(FOAM_USER_APPBIN)/Test-DataEntry

View File

@ -1,4 +1,5 @@
EXE_INC = \
-DFULLDEBUG -g -O0 \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \

View File

@ -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-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,6 +32,8 @@ Description
#include "fvCFD.H"
#include "DataEntry.H"
#include "IOdictionary.H"
#include "linearInterpolationWeights.H"
#include "splineInterpolationWeights.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -41,6 +43,62 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createMesh.H"
{
scalarField samples(4);
samples[0] = 0;
samples[1] = 1;
samples[2] = 2;
samples[3] = 3;
scalarField values(4);
values = 1.0;
//values[0] = 0.0;
//values[1] = 1.0;
//linearInterpolationWeights interpolator
splineInterpolationWeights interpolator
(
samples,
interpolationWeights::WARN
);
labelList indices;
scalarField weights;
interpolator.integrationWeights(1.1, 1.2, indices, weights);
Pout<< "indices:" << indices << endl;
Pout<< "weights:" << weights << endl;
scalar baseSum = interpolator.weightedSum
(
weights,
UIndirectList<scalar>(values, indices)
);
Pout<< "baseSum=" << baseSum << nl << nl << endl;
// interpolator.integrationWeights(-0.01, 0, indices, weights);
// scalar partialSum = interpolator.weightedSum
// (
// weights,
// UIndirectList<scalar>(values, indices)
// );
// Pout<< "partialSum=" << partialSum << nl << nl << endl;
//
//
// interpolator.integrationWeights(-0.01, 1, indices, weights);
// //Pout<< "samples:" << samples << endl;
// //Pout<< "indices:" << indices << endl;
// //Pout<< "weights:" << weights << endl;
// scalar sum = interpolator.weightedSum
// (
// weights,
// UIndirectList<scalar>(values, indices)
// );
// Pout<< "integrand=" << sum << nl << nl << endl;
return 1;
}
IOdictionary dataEntryProperties
(
IOobject

View File

@ -239,7 +239,8 @@ snapControls
// Leave out altogether to disable.
nFeatureSnapIter 10;
//- Detect (geometric) features by sampling the surface (default=false)
//- Detect (geometric only) features by sampling the surface
// (default=false).
implicitFeatureSnap false;
//- Use castellatedMeshControls::features (default = true)

View File

@ -92,8 +92,10 @@ patches
// Optional: explicitly set transformation tensor.
// Used when matching and synchronising points.
transform rotational;
rotationAxis ( 0 0 1 );
rotationCentre ( 0.3 0 0 );
rotationAxis (1 0 0);
rotationCentre (0 0 0);
// transform translational;
// separationVector (1 0 0);
}
// How to construct: either from 'patches' or 'set'

View File

@ -107,6 +107,7 @@ void writeWeights(const polyMesh& mesh)
int main(int argc, char *argv[])
{
# include "addRegionOption.H"
argList::addBoolOption
(
"checkAMI",
@ -115,7 +116,7 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
# include "createDynamicFvMesh.H"
# include "createNamedDynamicFvMesh.H"
const bool checkAMI = args.optionFound("checkAMI");

View File

@ -359,6 +359,20 @@ FoamFile
// cellSet c0; // name of cellSet of slave side
// }
//
//
// pointZoneSet
// ~~~~~~~~~~~~
// (mirrors operations on a pointSet into a pointZone)
//
// // Select based on pointSet
// source setToPointZone;
// sourceInfo
// {
// set p0; // name of pointSet
// }
//
//
//
actions
(

View File

@ -965,4 +965,34 @@ DimensionedConstants
}
DimensionSets
{
unitSet SI; // USCS
SICoeffs
{
// Basic units
kg kg [ 1 0 0 0 0 0 0 ] 1.0;
m m [ 0 1 0 0 0 0 0 ] 1.0;
s s [ 0 0 1 0 0 0 0 ] 1.0;
K K [ 0 0 0 1 0 0 0 ] 1.0;
mol mol [ 0 0 0 0 1 0 0 ] 1.0;
A A [ 0 0 0 0 0 1 0 ] 1.0;
Cd Cd [ 0 0 0 0 0 0 1 ] 1.0;
// Derived units
Pa Pa [ kg^1 m^-2 ] 1.0;
// Scaled units
mm mm [ kg^1 m^-2 ] 1e-3;
// Set of units used for printing. Can be any basic or derived
// but not scaled (only supported for dimensionedScalar, etc)
printUnits (kg m s K mol A Cd);
}
}
// ************************************************************************* //

View File

@ -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-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,7 +30,8 @@ License
template<class Type>
Foam::CompatibilityConstant<Type>::CompatibilityConstant
(
const word& entryName, const dictionary& dict
const word& entryName,
const dictionary& dict
)
:
DataEntry<Type>(entryName),
@ -69,6 +70,7 @@ Foam::CompatibilityConstant<Type>::CompatibilityConstant
dimensions_(cnst.dimensions_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>

View File

@ -27,13 +27,13 @@ Class
Description
Templated table container data entry. Items are stored in a list of
Tuple2's. First column is always stored as scalar entries. Data is read
in the form, e.g. for an entry \<entryName\> that is (scalar, vector):
in Tuple2 form, e.g. for an entry \<entryName\> that is (scalar, vector):
\verbatim
<entryName> table [0 1 0 0 0] //dimension set optional
<entryName> table
(
0.0 (1 2 3)
1.0 (4 5 6)
(0.0 (1 2 3))
(1.0 (4 5 6))
);
\endverbatim

View File

@ -0,0 +1,32 @@
Foam::word regionName;
if (args.optionReadIfPresent("region", regionName))
{
Foam::Info
<< "Create mesh " << regionName << " for time = "
<< runTime.timeName() << Foam::nl << Foam::endl;
}
else
{
regionName = Foam::fvMesh::defaultRegion;
Foam::Info
<< "Create mesh for time = "
<< runTime.timeName() << Foam::nl << Foam::endl;
}
autoPtr<dynamicFvMesh> meshPtr
(
dynamicFvMesh::New
(
IOobject
(
regionName,
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
)
);
dynamicFvMesh& mesh = meshPtr();

View File

@ -40,8 +40,9 @@ flowRateInletVelocityFvPatchVectorField
:
fixedValueFvPatchField<vector>(p, iF),
flowRate_(),
phiName_("phi"),
rhoName_("rho")
volumetric_(false),
rhoName_("rho"),
rhoInlet_(0.0)
{}
@ -56,8 +57,9 @@ flowRateInletVelocityFvPatchVectorField
:
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
flowRate_(ptf.flowRate_().clone().ptr()),
phiName_(ptf.phiName_),
rhoName_(ptf.rhoName_)
volumetric_(ptf.volumetric_),
rhoName_(ptf.rhoName_),
rhoInlet_(ptf.rhoInlet_)
{}
@ -69,11 +71,52 @@ flowRateInletVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchField<vector>(p, iF, dict),
flowRate_(DataEntry<scalar>::New("flowRate", dict)),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
{}
fixedValueFvPatchField<vector>(p, iF),
rhoInlet_(0.0)
{
if (dict.found("volumetricFlowRate"))
{
volumetric_ = true;
flowRate_ = DataEntry<scalar>::New("volumetricFlowRate", dict);
rhoName_ = "rho";
}
else if (dict.found("massFlowRate"))
{
volumetric_ = false;
flowRate_ = DataEntry<scalar>::New("massFlowRate", dict);
rhoName_ = word(dict.lookupOrDefault<word>("rho", "rho"));
}
else
{
FatalIOErrorIn
(
"flowRateInletVelocityFvPatchVectorField::"
"flowRateInletVelocityFvPatchVectorField"
"(const fvPatch&, const DimensionedField<vector, volMesh>&,"
" const dictionary&)",
dict
) << "Please supply either 'volumetricFlowRate' or"
<< " 'massFlowRate' and 'rho'" << exit(FatalIOError);
}
// Value field require if mass based
if (dict.found("value"))
{
fvPatchField<vector>::operator=
(
vectorField("value", dict, p.size())
);
}
else if (volumetric_)
{
evaluate(Pstream::blocking);
}
else
{
rhoInlet_ = readScalar(dict.lookup("rhoInlet"));
updateCoeffs(rhoInlet_);
}
}
Foam::flowRateInletVelocityFvPatchVectorField::
@ -84,8 +127,9 @@ flowRateInletVelocityFvPatchVectorField
:
fixedValueFvPatchField<vector>(ptf),
flowRate_(ptf.flowRate_().clone().ptr()),
phiName_(ptf.phiName_),
rhoName_(ptf.rhoName_)
volumetric_(ptf.volumetric_),
rhoName_(ptf.rhoName_),
rhoInlet_(ptf.rhoInlet_)
{}
@ -98,13 +142,44 @@ flowRateInletVelocityFvPatchVectorField
:
fixedValueFvPatchField<vector>(ptf, iF),
flowRate_(ptf.flowRate_().clone().ptr()),
phiName_(ptf.phiName_),
rhoName_(ptf.rhoName_)
volumetric_(ptf.volumetric_),
rhoName_(ptf.rhoName_),
rhoInlet_(ptf.rhoInlet_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs
(
const scalar uniformRho
)
{
if (updated())
{
return;
}
const scalar t = db().time().timeOutputValue();
// a simpler way of doing this would be nice
const scalar avgU = -flowRate_->value(t)/gSum(patch().magSf());
tmp<vectorField> n = patch().nf();
if (volumetric_ || rhoName_ == "none")
{
// volumetric flow-rate
operator==(n*avgU);
}
else
{
// mass flow-rate
operator==(n*avgU/uniformRho);
}
}
void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
{
if (updated())
@ -119,40 +194,18 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
tmp<vectorField> n = patch().nf();
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>(phiName_);
if (phi.dimensions() == dimVelocity*dimArea)
if (volumetric_ || rhoName_ == "none")
{
// volumetric flow-rate
// volumetric flow-rate or density not given
operator==(n*avgU);
}
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
if (rhoName_ == "none")
{
// volumetric flow-rate if density not given
operator==(n*avgU);
}
else
{
// mass flow-rate
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(n*avgU/rhop);
}
}
else
{
FatalErrorIn
(
"flowRateInletVelocityFvPatchVectorField::updateCoeffs()"
) << "dimensions of " << phiName_ << " are incorrect" << nl
<< " on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< nl << exit(FatalError);
// mass flow-rate
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(n*avgU/rhop);
}
fixedValueFvPatchField<vector>::updateCoeffs();
@ -163,8 +216,11 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchField<vector>::write(os);
flowRate_->writeData(os);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
if (!volumetric_)
{
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
os.writeKeyword("rhoInlet") << rhoInlet_ << token::END_STATEMENT << nl;
}
writeEntry("value", os);
}

View File

@ -28,21 +28,25 @@ Description
Describes a volumetric/mass flow normal vector boundary condition by its
magnitude as an integral over its area.
The basis of the patch (volumetric or mass) is determined by the
dimensions of the flux, phi.
If the flux is mass-based
- the current density is used to correct the velocity
- volumetric flow rate can be applied by setting the 'rho' entry to 'none'
Either specify 'volumetricFlowRate' or 'massFlowRate' (requires additional
'rho' entry).
Example of the boundary condition specification:
\verbatim
inlet
{
type flowRateInletVelocity;
flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
rho rho; // none | rho [m3/s or kg/s]
value uniform (0 0 0); // placeholder
type flowRateInletVelocity;
volumetricFlowRate 0.2; // Volumetric [m3/s]
}
\endverbatim
\verbatim
inlet
{
type flowRateInletVelocity;
volumetricFlowRate 0.2; // mass flow rate [kg/s]
rho rho; // rho [m3/s or kg/s]
value uniform (0 0 0); // placeholder
}
\endverbatim
@ -79,12 +83,15 @@ class flowRateInletVelocityFvPatchVectorField
//- Inlet integral flow rate
autoPtr<DataEntry<scalar> > flowRate_;
//- Name of the flux transporting the field
word phiName_;
//- Is volumetric?
bool volumetric_;
//- Name of the density field used to normalize the mass flux
word rhoName_;
//- Rho initialisation value (for start; if value not supplied)
scalar rhoInlet_;
public:
@ -157,6 +164,10 @@ public:
// Member functions
//- Update the coefficients associated with the patch field given
// uniform density field
void updateCoeffs(const scalar uniformRho);
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();

View File

@ -81,8 +81,14 @@ Foam::displacementSBRStressFvMotionSolver::displacementSBRStressFvMotionSolver
diffusivityPtr_
(
motionDiffusivity::New(fvMesh_, coeffDict().lookup("diffusivity"))
)
{}
),
solveOnPoints0_(coeffDict().lookupOrDefault("solveOnPoints0", false))
{
if (solveOnPoints0_)
{
Info<< type() << " : solving on points0" << endl;
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@ -123,11 +129,18 @@ void Foam::displacementSBRStressFvMotionSolver::solve()
diffusivityPtr_->correct();
pointDisplacement_.boundaryField().updateCoeffs();
pointField oldPoints;
if (solveOnPoints0_)
{
oldPoints = fvMesh_.points();
movePoints(points0());
}
surfaceScalarField Df(diffusivityPtr_->operator()());
volTensorField gradCd(fvc::grad(cellDisplacement_));
Foam::solve
tmp<fvMatrix<vector> > laplacianDf
(
fvm::laplacian
(
@ -135,7 +148,16 @@ void Foam::displacementSBRStressFvMotionSolver::solve()
cellDisplacement_,
"laplacian(diffusivity,cellDisplacement)"
)
);
// if (solveOnPoints0_)
// {
// movePoints(oldPoints);
// }
Foam::solve
(
laplacianDf
+ fvc::div
(
Df
@ -173,6 +195,12 @@ void Foam::displacementSBRStressFvMotionSolver::solve()
)
*/
);
if (solveOnPoints0_)
{
movePoints(points0());
}
}

View File

@ -53,7 +53,6 @@ class motionDiffusivity;
class displacementSBRStressFvMotionSolver
:
// public displacementFvMotionSolver
public displacementMotionSolver,
public fvMotionSolverCore
{
@ -65,6 +64,8 @@ class displacementSBRStressFvMotionSolver
//- Diffusivity used to control the motion
autoPtr<motionDiffusivity> diffusivityPtr_;
//- Solve on base mesh
Switch solveOnPoints0_;
// Private Member Functions

View File

@ -99,76 +99,6 @@ void Foam::autoLayerDriver::sumWeights
// Smooth field on moving patch
//void Foam::autoLayerDriver::smoothField
//(
// const motionSmoother& meshMover,
// const PackedBoolList& isMasterEdge,
// const labelList& meshEdges,
// const scalarField& fieldMin,
// const label nSmoothDisp,
// scalarField& field
//) const
//{
// const indirectPrimitivePatch& pp = meshMover.patch();
// const edgeList& edges = pp.edges();
// const labelList& meshPoints = pp.meshPoints();
//
// scalarField invSumWeight(pp.nPoints());
// sumWeights
// (
// isMasterEdge,
// meshEdges,
// meshPoints,
// edges,
// invSumWeight
// );
//
// // Get smoothly varying patch field.
// Info<< "shrinkMeshDistance : Smoothing field ..." << endl;
//
// for (label iter = 0; iter < nSmoothDisp; iter++)
// {
// scalarField average(pp.nPoints());
// averageNeighbours
// (
// meshMover.mesh(),
// isMasterEdge,
// meshEdges,
// meshPoints,
// pp.edges(),
// invSumWeight,
// field,
// average
// );
//
// // Transfer to field
// forAll(field, pointI)
// {
// //full smoothing neighbours + point value
// average[pointI] = 0.5*(field[pointI]+average[pointI]);
//
// // perform monotonic smoothing
// if
// (
// average[pointI] < field[pointI]
// && average[pointI] >= fieldMin[pointI]
// )
// {
// field[pointI] = average[pointI];
// }
// }
//
// // Do residual calculation every so often.
// if ((iter % 10) == 0)
// {
// Info<< " Iteration " << iter << " residual "
// << gSum(mag(field-average))
// /returnReduce(average.size(), sumOp<label>())
// << endl;
// }
// }
//}
//XXXXXXXXX
void Foam::autoLayerDriver::smoothField
(
const motionSmoother& meshMover,
@ -196,15 +126,9 @@ void Foam::autoLayerDriver::smoothField
// Get smoothly varying patch field.
Info<< "shrinkMeshDistance : Smoothing field ..." << endl;
const scalar lambda = 0.33;
const scalar mu = -0.34;
for (label iter = 0; iter < 90; iter++)
for (label iter = 0; iter < nSmoothDisp; iter++)
{
scalarField average(pp.nPoints());
// Calculate average of field
averageNeighbours
(
meshMover.mesh(),
@ -217,37 +141,23 @@ void Foam::autoLayerDriver::smoothField
average
);
forAll(field, i)
// Transfer to field
forAll(field, pointI)
{
if (field[i] >= fieldMin[i])
//full smoothing neighbours + point value
average[pointI] = 0.5*(field[pointI]+average[pointI]);
// perform monotonic smoothing
if
(
average[pointI] < field[pointI]
&& average[pointI] >= fieldMin[pointI]
)
{
field[i] = (1-lambda)*field[i]+lambda*average[i];
field[pointI] = average[pointI];
}
}
// Calculate average of field
averageNeighbours
(
meshMover.mesh(),
isMasterEdge,
meshEdges,
meshPoints,
pp.edges(),
invSumWeight,
field,
average
);
forAll(field, i)
{
if (field[i] >= fieldMin[i])
{
field[i] = (1-mu)*field[i]+mu*average[i];
}
}
// Do residual calculation every so often.
if ((iter % 10) == 0)
{
@ -259,6 +169,96 @@ void Foam::autoLayerDriver::smoothField
}
}
//XXXXXXXXX
//void Foam::autoLayerDriver::smoothField
//(
// const motionSmoother& meshMover,
// const PackedBoolList& isMasterEdge,
// const labelList& meshEdges,
// const scalarField& fieldMin,
// const label nSmoothDisp,
// scalarField& field
//) const
//{
// const indirectPrimitivePatch& pp = meshMover.patch();
// const edgeList& edges = pp.edges();
// const labelList& meshPoints = pp.meshPoints();
//
// scalarField invSumWeight(pp.nPoints());
// sumWeights
// (
// isMasterEdge,
// meshEdges,
// meshPoints,
// edges,
// invSumWeight
// );
//
// // Get smoothly varying patch field.
// Info<< "shrinkMeshDistance : (lambda-mu) Smoothing field ..." << endl;
//
//
// const scalar lambda = 0.33;
// const scalar mu = -0.34;
//
// for (label iter = 0; iter < 90; iter++)
// {
// scalarField average(pp.nPoints());
//
// // Calculate average of field
// averageNeighbours
// (
// meshMover.mesh(),
// isMasterEdge,
// meshEdges,
// meshPoints,
// pp.edges(),
// invSumWeight,
// field,
// average
// );
//
// forAll(field, i)
// {
// if (field[i] >= fieldMin[i])
// {
// field[i] = (1-lambda)*field[i]+lambda*average[i];
// }
// }
//
//
// // Calculate average of field
// averageNeighbours
// (
// meshMover.mesh(),
// isMasterEdge,
// meshEdges,
// meshPoints,
// pp.edges(),
// invSumWeight,
// field,
// average
// );
//
// forAll(field, i)
// {
// if (field[i] >= fieldMin[i])
// {
// field[i] = (1-mu)*field[i]+mu*average[i];
// }
// }
//
//
// // Do residual calculation every so often.
// if ((iter % 10) == 0)
// {
// Info<< " Iteration " << iter << " residual "
// << gSum(mag(field-average))
// /returnReduce(average.size(), sumOp<label>())
// << endl;
// }
// }
//}
//XXXXXXXXX
// Smooth normals on moving patch.
void Foam::autoLayerDriver::smoothPatchNormals

View File

@ -45,9 +45,6 @@ inline bool Foam::patchEdgeFaceRegion::update
if (w2.region_ == -2 || region_ == -2)
{
Pout<< "update : " << *this << " w2:" << w2 << " return FALSE" << endl;
// Blocked edge/face
return false;
}
@ -55,27 +52,18 @@ Pout<< "update : " << *this << " w2:" << w2 << " return FALSE" << endl;
if (!valid(td))
{
// current not yet set so use any value
label oldRegion = region_;
operator=(w2);
Pout<< "update : " << *this << " was:" << oldRegion
<< " w2:" << w2 << " return TRUE" << endl;
return true;
}
else
{
if (w2.region_ < region_)
{
label oldRegion = region_;
operator=(w2);
Pout<< "update : " << *this << " was:" << oldRegion
<< " w2:" << w2 << " return TRUE" << endl;
return true;
return true;
}
else
{
Pout<< "update : " << *this
<< " w2:" << w2 << " return FALSE" << endl;
return false;
}
}

View File

@ -37,7 +37,7 @@ boundaryField
burner
{
type flowRateInletVelocity;
flowRate constant 0.001294; //60kW C3H8
massFlowRate constant 0.001294; //60kW C3H8
value uniform (0 0 0);
}

View File

@ -43,7 +43,7 @@ boundaryField
inlet
{
type flowRateInletVelocity;
flowRate constant 0.1;
massFlowRate constant 0.1;
value uniform (0 0 0);
}
outlet

View File

@ -43,8 +43,8 @@ boundaryField
inlet
{
type flowRateInletVelocity;
flowRate constant 0.1;
value uniform (0 0 0);
massFlowRate constant 0.1;
rhoInlet 1; // estimate for initial rho
}
outlet
{

View File

@ -17,7 +17,7 @@ FoamFile
application rhoPimplecFoam;
startFrom startTime;
startFrom latestTime; //startTime;
startTime 0;

View File

@ -43,7 +43,7 @@ boundaryField
inlet
{
type flowRateInletVelocity;
flowRate constant 0.1;
massFlowRate constant 0.1;
value uniform (0 0 0);
}
outlet

View File

@ -43,7 +43,7 @@ boundaryField
inlet
{
type flowRateInletVelocity;
flowRate constant 0.1;
massFlowRate constant 0.1;
value uniform (0 0 0);
}
outlet

View File

@ -28,8 +28,8 @@ boundaryField
inlet
{
type flowRateInletVelocity;
flowRate constant 0.5;
value uniform (0 0 0);
massFlowRate constant 0.5;
rhoInlet 0.5; // Guess for rho
}
outlet
{

View File

@ -17,7 +17,7 @@ FoamFile
application rhoSimplecFoam;
startFrom startTime;
startFrom latestTime; //startTime;
startTime 0;

View File

@ -42,7 +42,7 @@ boundary
(
maxY
{
type empty;
type symmetryPlane;
faces
(
(3 7 6 2)
@ -51,7 +51,7 @@ boundary
minX
{
type empty;
type symmetryPlane;
faces
(
(0 4 7 3)
@ -60,7 +60,7 @@ boundary
maxX
{
type empty;
type symmetryPlane;
faces
(
(2 6 5 1)
@ -69,7 +69,7 @@ boundary
minY
{
type empty;
type symmetryPlane;
faces
(
(1 5 4 0)
@ -87,7 +87,7 @@ boundary
maxZ
{
type empty;
type symmetryPlane;
faces
(
(4 5 6 7)

View File

@ -19,25 +19,29 @@ FoamFile
(
maxY
{
type empty;
type symmetryPlane;
inGroups 1(symmetryPlane);
nFaces 400;
startFace 22800;
}
minX
{
type empty;
type symmetryPlane;
inGroups 1(symmetryPlane);
nFaces 400;
startFace 23200;
}
maxX
{
type empty;
type symmetryPlane;
inGroups 1(symmetryPlane);
nFaces 400;
startFace 23600;
}
minY
{
type empty;
type symmetryPlane;
inGroups 1(symmetryPlane);
nFaces 400;
startFace 24000;
}
@ -49,7 +53,8 @@ FoamFile
}
maxZ
{
type empty;
type symmetryPlane;
inGroups 1(symmetryPlane);
nFaces 400;
startFace 24800;
}

View File

@ -35,6 +35,18 @@ geometry
radius 4;
}
// // Define floor just so we have feature edges behave correctly
// floor
// {
// type searchablePlane;
// planeType pointAndNormal;
// pointAndNormalDict
// {
// basePoint (0 0 0);
// normalVector (0 0 1);
// }
// }
box1
{
type searchableBox;
@ -187,6 +199,11 @@ castellatedMeshControls
// Surface-wise min and max refinement level
level (1 1);
}
// floor
// {
// // Surface-wise min and max refinement level
// level (1 1);
// }
}
// Resolve sharp angles on fridges
@ -235,12 +252,15 @@ snapControls
{
//- Number of patch smoothing iterations before finding correspondence
// to surface
nSmoothPatch 3;
// nSmoothPatch 3;
//nSmoothPatch 0; //! Only since blockMesh aligned with surfaces it is
// actually beneficial to run with 0 smoothing.
nSmoothPatch 1;
//- Relative distance for points to be attracted by surface feature point
// or edge. True distance is this factor times local
// maximum edge length.
tolerance 4.0;
tolerance 2.0;
//- Number of mesh displacement relaxation iterations.
nSolveIter 30;
@ -248,6 +268,19 @@ snapControls
//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
// Feature snapping
//- Number of feature edge snapping iterations.
// Leave out altogether to disable.
nFeatureSnapIter 10;
//- Detect (geometric) features by sampling the surface (default=false)
implicitFeatureSnap true;
//- Use castellatedMeshControls::features (default = true)
explicitFeatureSnap false;
}
@ -281,7 +314,7 @@ addLayersControls
// Relative to undistorted size of cell outside layer.
// is the thickness of the layer furthest away from the wall.
// See relativeSizes parameter.
finalLayerThickness 0.5;
finalLayerThickness 1;
//- Minimum thickness of cell layer. If for any reason layer
// cannot be above minThickness do not add layer.
@ -342,52 +375,7 @@ addLayersControls
// where to undo.
meshQualityControls
{
//- Maximum non-orthogonality allowed. Set to 180 to disable.
maxNonOrtho 65;
//- Max skewness allowed. Set to <0 to disable.
maxBoundarySkewness 20;
maxInternalSkewness 4;
//- Max concaveness allowed. Is angle (in degrees) below which concavity
// is allowed. 0 is straight face, <0 would be convex face.
// Set to 180 to disable.
maxConcave 80;
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to a sensible fraction of the smallest cell volume expected.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-13;
//- Minimum quality of the tet formed by the face-centre
// and variable base point minimum decomposition triangles and
// the cell centre. Set to very negative number (e.g. -1E30) to
// disable.
// <0 = inside out tet,
// 0 = flat tet
// 1 = regular tet
minTetQuality 1e-30;
//- Minimum face area. Set to <0 to disable.
minArea -1;
//- Minimum face twist. Set to <-1 to disable. dot product of face normal
//- and face centre triangles normal
minTwist 0.05;
//- minimum normalised cell determinant
//- 1 = hex, <= 0 = folded or flattened illegal cell
minDeterminant 0.001;
//- minFaceWeight (0 -> 0.5)
minFaceWeight 0.05;
//- minVolRatio (0 -> 1)
minVolRatio 0.01;
//must be >0 for Fluent compatibility
minTriangleTwist -1;
#include "meshQualityDict"
// Advanced
@ -405,7 +393,7 @@ meshQualityControls
// 1 : write intermediate meshes
// 2 : write volScalarField with cellLevel for postprocessing
// 4 : write current intersections as .obj files
debug 0;
debug 7;
// Merge tolerance. Is fraction of overall bounding box of initial mesh.

View File

@ -32,12 +32,14 @@ FoamFile
front
{
type empty;
inGroups 1(empty);
nFaces 3072;
startFace 6336;
}
back
{
type empty;
inGroups 1(empty);
nFaces 3072;
startFace 9408;
}

View File

@ -46,6 +46,7 @@ boundary
(
(3 7 6 2)
);
inGroups (groupWall);
}
fixedWalls
{
@ -56,6 +57,7 @@ boundary
(2 6 5 1)
(1 5 4 0)
);
inGroups (groupWall);
}
frontAndBack
{

View File

@ -39,7 +39,7 @@ divSchemes
laplacianSchemes
{
default Gauss linear corrected;
default Gauss linear limited 0.33;
}
interpolationSchemes
@ -49,7 +49,7 @@ interpolationSchemes
snGradSchemes
{
default corrected;
default limited 0.33;
}
fluxRequired

View File

@ -17,7 +17,7 @@ FoamFile
numberOfSubdomains 8;
method hierarchical;
method hierarchical; //ptscotch;
simpleCoeffs
{

View File

@ -43,8 +43,7 @@ boundaryField
inlet
{
type flowRateInletVelocity;
flowRate constant 0.1;
value uniform (0 0 0);
volumetricFlowRate constant 0.1;
}
outlet
{

View File

@ -17,7 +17,7 @@ FoamFile
application porousSimpleFoam;
startFrom startTime;
startFrom latestTime; //startTime;
startTime 0;

View File

@ -58,7 +58,6 @@ functions
type forces;
functionObjectLibs ("libforces.so");
outputControl outputTime;
outputInterval 1;
patches (floatingObject);
pName p;
UName U;
@ -74,7 +73,7 @@ functions
functionObjectLibs ("libfieldFunctionObjects.so");
enabled true;
outputControl timeStep;
timeInteval 1;
outputInterval 1;
log true;
valueOutput false;
source faceZone;

View File

@ -14,6 +14,8 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
libs ("libincompressibleRASModels.so");
application simpleFoam;
startFrom latestTime;

View File

@ -32,13 +32,13 @@ boundaryField
inletCentral
{
type flowRateInletVelocity;
flowRate constant 0.00379;
massFlowRate constant 0.00379;
value uniform (0 14.68 0);
}
inletSides
{
type flowRateInletVelocity;
flowRate constant 0.00832;
massFlowRate constant 0.00832;
value uniform (0 17.79 0);
}
outlet

View File

@ -32,13 +32,13 @@ boundaryField
inletCentral
{
type flowRateInletVelocity;
flowRate constant 0.00379;
massFlowRate constant 0.00379;
value uniform (0 14.68 0);
}
inletSides
{
type flowRateInletVelocity;
flowRate constant 0.00832;
massFlowRate constant 0.00832;
value uniform (0 17.79 0);
}
outlet

View File

@ -32,13 +32,13 @@ boundaryField
inletCentral
{
type flowRateInletVelocity;
flowRate constant 0.00379;
massFlowRate constant 0.00379;
value uniform (0 14.68 0);
}
inletSides
{
type flowRateInletVelocity;
flowRate constant 0.00832;
massFlowRate constant 0.00832;
value uniform (0 17.79 0);
}
outlet

View File

@ -32,13 +32,13 @@ boundaryField
inletCentral
{
type flowRateInletVelocity;
flowRate constant 0.00379;
massFlowRate constant 0.00379;
value uniform (0 14.68 0);
}
inletSides
{
type flowRateInletVelocity;
flowRate constant 0.00832;
massFlowRate constant 0.00832;
value uniform (0 17.79 0);
}
outlet

View File

@ -83,4 +83,4 @@ solid ascii
vertex 1.3 -0.9 1
endloop
endfacet
endsolid
end solid

View File

@ -25,6 +25,7 @@ solver displacementSBRStress; //displacementLaplacian;
displacementSBRStressCoeffs
{
solveOnPoints0 true;
// diffusivity uniform;
// diffusivity directional (1 200 0);
// diffusivity motionDirectional (1 1000 0);

View File

@ -31,7 +31,8 @@ vertices
blocks
(
hex (0 1 2 3 4 5 6 7) (20 60 60) simpleGrading (10.0 1 1)
// hex (0 1 2 3 4 5 6 7) (20 60 60) simpleGrading (10.0 1 1)
hex (0 1 2 3 4 5 6 7) (6 6 6) simpleGrading (10.0 1 1)
);
edges

View File

@ -8,7 +8,7 @@
FoamFile
{
version 2.0;
format binary;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
@ -20,38 +20,38 @@ FoamFile
maxX
{
type patch;
nFaces 1200;
startFace 210000;
nFaces 36;
startFace 540;
}
minZ
{
type patch;
nFaces 3600;
startFace 211200;
nFaces 36;
startFace 576;
}
maxZ
{
type patch;
nFaces 3600;
startFace 214800;
nFaces 36;
startFace 612;
}
minX
{
type patch;
nFaces 1200;
startFace 218400;
nFaces 36;
startFace 648;
}
minY
{
type patch;
nFaces 1200;
startFace 219600;
nFaces 36;
startFace 684;
}
maxY
{
type patch;
nFaces 1200;
startFace 220800;
nFaces 36;
startFace 720;
}
)

View File

@ -17,23 +17,23 @@ FoamFile
application moveDynamicMesh;
startFrom startTime;
startFrom latestTime; //startTime;
startTime 0;
stopAt endTime;
endTime 25;
endTime 30;
deltaT 1;
writeControl timeStep;
writeInterval 5;
writeInterval 1;
purgeWrite 0;
writeFormat binary;
writeFormat ascii;//binary;
writePrecision 6;

View File

@ -17,7 +17,7 @@ FoamFile
application icoFoam;
startFrom startTime;
startFrom latestTime;
startTime 0;

View File

@ -16,7 +16,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Which of the steps to run
castellatedMesh true;
castellatedMesh false;
snap true;
addLayers false;
@ -85,10 +85,10 @@ castellatedMeshControls
// This is a featureEdgeMesh, read from constant/triSurface for now.
features
(
{
file "flange.eMesh";
level 0;
}
// {
// file "flange.eMesh";
// level 0;
// }
);
@ -175,9 +175,17 @@ snapControls
// before upon reaching a correct mesh.
nRelaxIter 5;
//- Highly experimental and wip: number of feature edge snapping
// iterations. Leave out altogether to disable.
nFeatureSnapIter 10;
// Feature snapping
//- Number of feature edge snapping iterations.
// Leave out altogether to disable.
nFeatureSnapIter 10;
//- Detect (geometric) features by sampling the surface
implicitFeatureSnap true;
//- Use castellatedMeshControls::features
explicitFeatureSnap false;
}

View File

@ -59,7 +59,6 @@ functions
type probes;
functionObjectLibs ("libsampling.so");
outputControl outputTime;
outputInterval 1;
probeLocations
(
( 0 9.95 19.77 )
@ -76,9 +75,7 @@ functions
type surfaces;
functionObjectLibs ("libsampling.so");
outputControl outputTime;
outputInterval 10;
surfaceFormat raw;
interpolationScheme isThisNeeded;
fields
(
p

View File

@ -58,7 +58,6 @@ functions
type probes;
functionObjectLibs ("libsampling.so");
outputControl outputTime;
outputInterval 1;
probeLocations
(
( 0 9.95 19.77 )
@ -75,9 +74,7 @@ functions
type surfaces;
functionObjectLibs ("libsampling.so");
outputControl outputTime;
outputInterval 10;
surfaceFormat raw;
interpolationScheme isThisNeeded;
fields
(
p

View File

@ -23,8 +23,7 @@ boundaryField
inlet
{
type flowRateInletVelocity;
flowRate constant 50;
value uniform (0 0 0);
volumetricFlowRate constant 50;
}
walls

View File

@ -6,7 +6,7 @@ cc = gcc -m64
include $(RULES)/c$(WM_COMPILE_OPTION)
cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
cFLAGS = -g $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@

View File

@ -8,7 +8,7 @@ include $(RULES)/c++$(WM_COMPILE_OPTION)
ptFLAGS = -DNoRepository -ftemplate-depth-100
c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
c++FLAGS = -g $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
cxxtoo = $(Ctoo)