Remove trailing whitespace systematically

This commit is contained in:
Henrik Rusche 2014-06-01 20:12:52 +02:00
parent dd542da6e1
commit c458150bfc
293 changed files with 1301 additions and 1301 deletions

View file

@ -7,19 +7,19 @@ then
echo "Error: Current directory is not \$WM_PROJECT_DIR" echo "Error: Current directory is not \$WM_PROJECT_DIR"
echo " The environment variables are not consistent with the installation." echo " The environment variables are not consistent with the installation."
echo " Please source configuration files." echo " Please source configuration files."
echo echo
echo "Examples:" echo "Examples:"
echo " bash: . etc/bashrc" echo " bash: . etc/bashrc"
echo " tcsh: source etc/cshrc" echo " tcsh: source etc/cshrc"
echo echo
echo " If you sourced the configuration files, please check the 'foamInstall' entry." echo " If you sourced the configuration files, please check the 'foamInstall' entry."
echo echo
exit 1 exit 1
fi fi
if [ -z "$PARAVIEW_SYSTEM" ] && [ -z "$QT_BIN_DIR" ] if [ -z "$PARAVIEW_SYSTEM" ] && [ -z "$QT_BIN_DIR" ]
then then
echo echo
echo "\$QT_BIN_DIR not set. To compile Paraview from sources" echo "\$QT_BIN_DIR not set. To compile Paraview from sources"
echo "the command \$QT_BIN_DIR/qmake needs to be valid." echo "the command \$QT_BIN_DIR/qmake needs to be valid."
echo echo
@ -27,13 +27,13 @@ then
echo " Ubuntu: \"export QT_BIN_DIR=/usr/bin\"" echo " Ubuntu: \"export QT_BIN_DIR=/usr/bin\""
echo " Fedora: \"export QT_BIN_DIR=/usr/lib64/qt4/bin\"" echo " Fedora: \"export QT_BIN_DIR=/usr/lib64/qt4/bin\""
echo " openSuse: \"export QT_BIN_DIR=/usr/bin\"" echo " openSuse: \"export QT_BIN_DIR=/usr/bin\""
echo echo
read -r -p "Proceed without compiling ParaView [Y/n] " response read -r -p "Proceed without compiling ParaView [Y/n] " response
if [[ $response =~ ^([nN][oO]|[nN])$ ]] if [[ $response =~ ^([nN][oO]|[nN])$ ]]
then then
exit 0 exit 0
fi fi
fi fi
# Check whether we will be compiling cudaSolvers # Check whether we will be compiling cudaSolvers
if [ -f $CUDA_BIN_DIR/nvcc ] if [ -f $CUDA_BIN_DIR/nvcc ]
@ -43,12 +43,12 @@ then
echo "cudaSolvers will be compiled by default." echo "cudaSolvers will be compiled by default."
echo echo
# If yes, check presence of $CUDA_ARCH # If yes, check presence of $CUDA_ARCH
if [ -z "$CUDA_ARCH" ] if [ -z "$CUDA_ARCH" ]
then then
echo echo
echo "\$CUDA_ARCH is required by nvcc compiler but not set." echo "\$CUDA_ARCH is required by nvcc compiler but not set."
echo "Check section '-gpu-architecture' in 'man nvcc' for details." echo "Check section '-gpu-architecture' in 'man nvcc' for details."
echo echo
read -r -p "Proceed without compiling cudaSolvers? [Y/n] " response read -r -p "Proceed without compiling cudaSolvers? [Y/n] " response
if [[ $response =~ ^([nN][oO]|[nN])$ ]] if [[ $response =~ ^([nN][oO]|[nN])$ ]]

View file

@ -16,7 +16,7 @@ Contents:
* List of Contributors * List of Contributors
(If your name is missing in the list, please contact the maintainers at (If your name is missing in the list, please contact the maintainers at
and it will be added asap.) and it will be added asap.)
Henry Weller Henry Weller

View file

@ -3,7 +3,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \

View file

@ -3,7 +3,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \

View file

@ -3,7 +3,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \

View file

@ -4,8 +4,8 @@ set -x
wmake libso conjugateHeatTransfer wmake libso conjugateHeatTransfer
wmake blockCoupledScalarTransportFoam wmake blockCoupledScalarTransportFoam
wmake conjugateHeatFoam wmake conjugateHeatFoam
wmake conjugateHeatSimpleFoam wmake conjugateHeatSimpleFoam
wmake pUCoupledFoam wmake pUCoupledFoam
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View file

@ -14,5 +14,5 @@
} }
// Force recalculation of weights // Force recalculation of weights
mesh.surfaceInterpolation::movePoints(); mesh.surfaceInterpolation::movePoints();
} }

View file

@ -25,6 +25,6 @@
} }
// Force recalculation of weights // Force recalculation of weights
solidMesh.surfaceInterpolation::movePoints(); solidMesh.surfaceInterpolation::movePoints();
} }

View file

@ -14,5 +14,5 @@
} }
// Force recalculation of weights // Force recalculation of weights
mesh.surfaceInterpolation::movePoints(); mesh.surfaceInterpolation::movePoints();
} }

View file

@ -1,5 +1,5 @@
singlePhaseTransportModel laminarTransport(U, phi); singlePhaseTransportModel laminarTransport(U, phi);
// Density [kg/m^3] // Density [kg/m^3]
dimensionedScalar rho(laminarTransport.lookup("rho")); dimensionedScalar rho(laminarTransport.lookup("rho"));

View file

@ -1,3 +1,3 @@
conjugateHeatSimpleFoam.C conjugateHeatSimpleFoam.C
EXE = $(FOAM_APPBIN)/conjugateHeatSimpleFoam EXE = $(FOAM_APPBIN)/conjugateHeatSimpleFoam

View file

@ -14,5 +14,5 @@
} }
// Force recalculation of weights // Force recalculation of weights
mesh.surfaceInterpolation::movePoints(); mesh.surfaceInterpolation::movePoints();
} }

View file

@ -25,6 +25,6 @@
} }
// Force recalculation of weights // Force recalculation of weights
solidMesh.surfaceInterpolation::movePoints(); solidMesh.surfaceInterpolation::movePoints();
} }

View file

@ -14,7 +14,7 @@
} }
// Force recalculation of weights // Force recalculation of weights
mesh.surfaceInterpolation::movePoints(); mesh.surfaceInterpolation::movePoints();
} }
/* /*
{ {
@ -33,6 +33,6 @@
} }
// Force recalculation of weights // Force recalculation of weights
solidMesh.surfaceInterpolation::movePoints(); solidMesh.surfaceInterpolation::movePoints();
} }
*/ */

View file

@ -1,5 +1,5 @@
singlePhaseTransportModel laminarTransport(U, phi); singlePhaseTransportModel laminarTransport(U, phi);
// Density [kg/m^3] // Density [kg/m^3]
dimensionedScalar rho(laminarTransport.lookup("rho")); dimensionedScalar rho(laminarTransport.lookup("rho"));

View file

@ -1,7 +1,7 @@
thermalModel/thermalModel.C thermalModel/thermalModel.C
thermalLaws = thermalModel/thermalLaws thermalLaws = thermalModel/thermalLaws
$(thermalLaws)/thermalLaw/thermalLaw.C $(thermalLaws)/thermalLaw/thermalLaw.C
$(thermalLaws)/thermalLaw/newThermalLaw.C $(thermalLaws)/thermalLaw/newThermalLaw.C
$(thermalLaws)/constantThermal/constantThermal.C $(thermalLaws)/constantThermal/constantThermal.C
$(thermalLaws)/multiMaterialThermal/multiMaterialThermal.C $(thermalLaws)/multiMaterialThermal/multiMaterialThermal.C
@ -9,7 +9,7 @@ $(thermalLaws)/multiMaterialZonesThermal/multiMaterialZonesThermal.C
thermalGaps = thermalModel/thermalGaps thermalGaps = thermalModel/thermalGaps
$(thermalGaps)/thermalGap/thermalGap.C $(thermalGaps)/thermalGap/thermalGap.C
$(thermalGaps)/thermalGap/newThermalGap.C $(thermalGaps)/thermalGap/newThermalGap.C
$(thermalGaps)/constantThermalGap/constantThermalGap.C $(thermalGaps)/constantThermalGap/constantThermalGap.C
$(thermalGaps)/constantResistanceThermalGap/constantResistanceThermalGap.C $(thermalGaps)/constantResistanceThermalGap/constantResistanceThermalGap.C

View file

@ -14,5 +14,5 @@
} }
// Force recalculation of weights // Force recalculation of weights
mesh.surfaceInterpolation::movePoints(); mesh.surfaceInterpolation::movePoints();
} }

View file

@ -82,11 +82,11 @@ Foam::heatFlux::~heatFlux()
void Foam::heatFlux::calcAndPrint() void Foam::heatFlux::calcAndPrint()
{ {
const volScalarField& T = const volScalarField& T =
obr_.lookupObject<volScalarField>("T"); obr_.lookupObject<volScalarField>("T");
const volScalarField& kappaEff = const volScalarField& kappaEff =
obr_.lookupObject<volScalarField>(Kfluid_); obr_.lookupObject<volScalarField>(Kfluid_);
//const surfaceScalarField& kappaEff = //const surfaceScalarField& kappaEff =
// obr_.lookupObject<surfaceScalarField>(Kfluid_); // obr_.lookupObject<surfaceScalarField>(Kfluid_);
scalar rho = 1.2; scalar rho = 1.2;
@ -103,8 +103,8 @@ void Foam::heatFlux::calcAndPrint()
//const surfaceScalarField::GeometricBoundaryField& patchHeatFluxD = //const surfaceScalarField::GeometricBoundaryField& patchHeatFluxD =
// heatFluxC.boundaryField(); // heatFluxC.boundaryField();
//surfaceScalarField::GeometricBoundaryField patchHeatFluxC = //surfaceScalarField::GeometricBoundaryField patchHeatFluxC =
scalar sumConduction = 0.0; scalar sumConduction = 0.0;
scalar sumConvection = 0.0; scalar sumConvection = 0.0;
scalar sumRadiation = 0.0; scalar sumRadiation = 0.0;
@ -143,7 +143,7 @@ void Foam::heatFlux::calcAndPrint()
if(obr_.foundObject<surfaceScalarField>("phi")) if(obr_.foundObject<surfaceScalarField>("phi"))
{ {
const surfaceScalarField& phi = const surfaceScalarField& phi =
obr_.lookupObject<surfaceScalarField>("phi"); obr_.lookupObject<surfaceScalarField>("phi");
convection = gSum convection = gSum

View file

@ -213,9 +213,9 @@ chtRcThermalDiffusivityFvPatchScalarField::calcThermalDiffusivity
//Info << "Qr = " << Qr << endl; //Info << "Qr = " << Qr << endl;
//Info << "kOwn + kNei = " << (kOwn + kNei) << endl; //Info << "kOwn + kNei = " << (kOwn + kNei) << endl;
//Info << "k = " << k << endl; //Info << "k = " << k << endl;
k = kOwn*(TwOwn*(kNei*(TcNei - TcOwn) + Qr + fourQro) - TcOwn*fourQro); k = kOwn*(TwOwn*(kNei*(TcNei - TcOwn) + Qr + fourQro) - TcOwn*fourQro);
k /= stabilise((fourQro + TwOwn*(kOwn + kNei))*(TcNei - TcOwn), SMALL); k /= stabilise((fourQro + TwOwn*(kOwn + kNei))*(TcNei - TcOwn), SMALL);
k /= p.deltaCoeffs(); k /= p.deltaCoeffs();

View file

@ -260,7 +260,7 @@ chtRcThermalDiffusivityResistanceFvPatchScalarField::calcThermalDiffusivity
k /= stabilise(TcOwn - TcNei, SMALL)*p.deltaCoeffs(); k /= stabilise(TcOwn - TcNei, SMALL)*p.deltaCoeffs();
*/ */
// Expression is equivalent to the one above // Expression is equivalent to the one above
k = kOwn* k = kOwn*
( (
TwOwn* TwOwn*

View file

@ -25,7 +25,7 @@ Class
regionCouplingResistanceFvPatchField regionCouplingResistanceFvPatchField
Description Description
Region couple patch field jump resistance on the surface taking Region couple patch field jump resistance on the surface taking
radiation into account radiation into account
Author Author

View file

@ -85,7 +85,7 @@ controlledParabolicVelocityFvPatchVectorField::controlledParabolicVelocityFvPatc
: :
fixedValueFvPatchVectorField(p, iF), fixedValueFvPatchVectorField(p, iF),
Umean_(readScalar(dict.lookup("Umean"))), Umean_(readScalar(dict.lookup("Umean"))),
n_(dict.lookup("n")), n_(dict.lookup("n")),
y_(dict.lookup("y")), y_(dict.lookup("y")),
target_(readScalar(dict.lookup("target"))), target_(readScalar(dict.lookup("target"))),
obsFieldName_(dict.lookup("obsFieldName")), obsFieldName_(dict.lookup("obsFieldName")),
@ -168,7 +168,7 @@ void controlledParabolicVelocityFvPatchVectorField::updateCoeffs()
const vectorField& c = patch().Cf(); const vectorField& c = patch().Cf();
// Calculate local 1-D coordinate for the parabolic profile // Calculate local 1-D coordinate for the parabolic profile
scalarField coord = scalarField coord =
0.5 - ((c - ctr) & y_)/((bb.max() - bb.min()) & y_); 0.5 - ((c - ctr) & y_)/((bb.max() - bb.min()) & y_);
operator==(n_*3/2*Umean_*(1.0 - sqr(coord))); operator==(n_*3/2*Umean_*(1.0 - sqr(coord)));

View file

@ -58,7 +58,7 @@ class controlledParabolicVelocityFvPatchVectorField
{ {
// Private data // Private data
//- Volumetric flow rate //- Volumetric flow rate
scalar Umean_; scalar Umean_;
//- Flow direction //- Flow direction

View file

@ -204,7 +204,7 @@ void Foam::extendedWallHeatTransferFvPatchScalarField::write(Ostream& os) const
os << nl << indent << "radiationSources" << nl os << nl << indent << "radiationSources" << nl
<< indent << token::BEGIN_LIST << incrIndent << nl; << indent << token::BEGIN_LIST << incrIndent << nl;
forAll(radSources_, rsI) forAll(radSources_, rsI)
{ {
os << indent << radSources_[rsI].name() << nl os << indent << radSources_[rsI].name() << nl

View file

@ -27,7 +27,7 @@ Class
Description Description
helper class to sum up external radiation sources helper class to sum up external radiation sources
SourceFiles SourceFiles
viewFactorRadiation.C viewFactorRadiation.C

View file

@ -27,7 +27,7 @@ Class
Description Description
helper class to sum up external radiation sources helper class to sum up external radiation sources
SourceFiles SourceFiles
ersConstantFlux.C ersConstantFlux.C

View file

@ -27,7 +27,7 @@ Class
Description Description
helper class to sum up external radiation sources helper class to sum up external radiation sources
SourceFiles SourceFiles
ersPlaneToCylinder.C ersPlaneToCylinder.C

View file

@ -27,7 +27,7 @@ Class
Description Description
helper class to sum up external radiation sources helper class to sum up external radiation sources
SourceFiles SourceFiles
ersPointSource.C ersPointSource.C

View file

@ -27,7 +27,7 @@ Class
Description Description
helper class to sum up external radiation sources helper class to sum up external radiation sources
SourceFiles SourceFiles
ersViewFactor.C ersViewFactor.C

View file

@ -27,7 +27,7 @@ Class
Description Description
Virtual base class for external radiation sources Virtual base class for external radiation sources
SourceFiles SourceFiles
externalRadiationSource.C externalRadiationSource.C

View file

@ -75,14 +75,14 @@ protected:
// Protected member functions // Protected member functions
//- Check that the laws and the material field are okay //- Check that the laws and the material field are okay
void readLaws void readLaws
( (
const volScalarField& T, const volScalarField& T,
const dictionary& dict const dictionary& dict
); );
//- Check that the laws and the material field are okay //- Check that the laws and the material field are okay
void checkLaws() const; void checkLaws() const;

View file

@ -1,3 +1,3 @@
pUCoupledFoam.C pUCoupledFoam.C
EXE = $(FOAM_APPBIN)/pUCoupledFoam EXE = $(FOAM_APPBIN)/pUCoupledFoam

View file

@ -12,4 +12,4 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-llduSolvers \ -llduSolvers \
-lVectorN -lVectorN

View file

@ -1,3 +1,3 @@
equationReaderDemo.C equationReaderDemo.C
EXE = $(FOAM_APPBIN)/equationReaderDemo EXE = $(FOAM_APPBIN)/equationReaderDemo

View file

@ -3,18 +3,18 @@
// We could try addSource(runTime), but since runTime.name() // We could try addSource(runTime), but since runTime.name()
// constantly changes, we assign it our own name: // constantly changes, we assign it our own name:
eqns.scalarSources().addSource(runTime.value(), "t", dimTime); eqns.scalarSources().addSource(runTime.value(), "t", dimTime);
// Add mesh coordinates (cell centres) gives variable names: // Add mesh coordinates (cell centres) gives variable names:
// C.x, C.y, C.z // C.x, C.y, C.z
eqns.vectorSources().addSource(mesh.C()); eqns.vectorSources().addSource(mesh.C());
// Add mesh volumes // Add mesh volumes
eqns.scalarSources().addSource(mesh.V()); eqns.scalarSources().addSource(mesh.V());
// Add simpleFoam's existing variables // Add simpleFoam's existing variables
eqns.scalarSources().addSource(p); eqns.scalarSources().addSource(p);
eqns.vectorSources().addSource(U); eqns.vectorSources().addSource(U);
// Adding a "derived" variable - one that exists only temporarily e.g.: // Adding a "derived" variable - one that exists only temporarily e.g.:
// turbulence->R() - since it does not permanently exist, this won't // turbulence->R() - since it does not permanently exist, this won't
// work: // work:
@ -49,18 +49,18 @@
); );
eqns.addSource(equationDict); eqns.addSource(equationDict);
// Generic sources for demo purposes: // Generic sources for demo purposes:
// Scalars // Scalars
scalar sA(1.0); scalar sA(1.0);
scalar sB(2.0); scalar sB(2.0);
scalar sC(3.0); scalar sC(3.0);
eqns.scalarSources().addSource(sA, "sA"); eqns.scalarSources().addSource(sA, "sA");
eqns.scalarSources().addSource(sB, "sB"); eqns.scalarSources().addSource(sB, "sB");
eqns.scalarSources().addSource(sC, "sC"); eqns.scalarSources().addSource(sC, "sC");
// Dimensioned scalars // Dimensioned scalars
dimensionedScalar dsA("dsA", dimless, 4.0); dimensionedScalar dsA("dsA", dimless, 4.0);
dimensionedScalar dsB("dsB", dimless, 5.0); dimensionedScalar dsB("dsB", dimless, 5.0);
@ -131,7 +131,7 @@
eqns.vectorSources().addSource(vA, "vA"); eqns.vectorSources().addSource(vA, "vA");
eqns.vectorSources().addSource(vB, "vB"); eqns.vectorSources().addSource(vB, "vB");
eqns.vectorSources().addSource(vC, "vC"); eqns.vectorSources().addSource(vC, "vC");
dimensionedVector dvA("dvA", dimless, vector(400.0, 400.0, 400.0)); dimensionedVector dvA("dvA", dimless, vector(400.0, 400.0, 400.0));
dimensionedVector dvB("dvB", dimless, vector(500.0, -500.0, 500.0)); dimensionedVector dvB("dvB", dimless, vector(500.0, -500.0, 500.0));
dimensionedVector dvC("dvC", dimless, vector(600.0, 600.0, -600.0)); dimensionedVector dvC("dvC", dimless, vector(600.0, 600.0, -600.0));
@ -382,7 +382,7 @@
eqns.readEquation(equationDict, "dsOut"); eqns.readEquation(equationDict, "dsOut");
eqns.readEquation(equationDict, "dsfOut"); eqns.readEquation(equationDict, "dsfOut");
eqns.readEquation(equationDict, "volSfOut"); eqns.readEquation(equationDict, "volSfOut");
// vector equations // vector equations
eqns.readEquation(equationDict, "vOut.x"); eqns.readEquation(equationDict, "vOut.x");
eqns.readEquation(equationDict, "vOut.y"); eqns.readEquation(equationDict, "vOut.y");
@ -396,7 +396,7 @@
eqns.readEquation(equationDict, "volVfOut.x"); eqns.readEquation(equationDict, "volVfOut.x");
eqns.readEquation(equationDict, "volVfOut.y"); eqns.readEquation(equationDict, "volVfOut.y");
eqns.readEquation(equationDict, "volVfOut.z"); eqns.readEquation(equationDict, "volVfOut.z");
// tensor equations // tensor equations
eqns.readEquation(equationDict, "tOut.xx"); eqns.readEquation(equationDict, "tOut.xx");
eqns.readEquation(equationDict, "tOut.xy"); eqns.readEquation(equationDict, "tOut.xy");
@ -449,7 +449,7 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
) )
); );
// scalars // scalars
scalar scalarOut; scalar scalarOut;
dimensionedScalar dimensionedScalarOut dimensionedScalar dimensionedScalarOut

View file

@ -64,7 +64,7 @@ int main(int argc, char *argv[])
// Only necessary if we revisit the same solver domain twice in the same // Only necessary if we revisit the same solver domain twice in the same
// superLoop (scalarTransportFoam, in this case) // superLoop (scalarTransportFoam, in this case)
multiRun++; multiRun++;
// * * * * * * * * * * * * * * * * icoFoam2 * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * icoFoam2 * * * * * * * * * * * * * * * * //
Info << "*** Switching to icoFoam2 ***\n" << endl; Info << "*** Switching to icoFoam2 ***\n" << endl;

View file

@ -31,7 +31,7 @@
volScalarField rUA = 1.0/UEqn.A(); volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H(); U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf()) phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi); + fvc::ddtPhiCorr(rUA, U, phi);
adjustPhi(phi, U, p); adjustPhi(phi, U, p);

View file

@ -22,7 +22,7 @@ License
along with foam-extend. If not, see <http://www.gnu.org/licenses/>. along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
Description Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "error.H" #include "error.H"

View file

@ -25,7 +25,7 @@ Class
contactPatchPair contactPatchPair
Description Description
SourceFiles SourceFiles
contactPatchPair.C contactPatchPair.C
contactPatchPairSlavePressure.C contactPatchPairSlavePressure.C

View file

@ -22,7 +22,7 @@ License
along with foam-extend. If not, see <http://www.gnu.org/licenses/>. along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
Description Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "contactPatchPair.H" #include "contactPatchPair.H"

View file

@ -22,7 +22,7 @@ License
along with foam-extend. If not, see <http://www.gnu.org/licenses/>. along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
Description Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "contactPatchPair.H" #include "contactPatchPair.H"

View file

@ -25,7 +25,7 @@ Application
stressedFoam stressedFoam
Description Description
Transient/steady-state solver of linear-elastic, small-strain deformation Transient/steady-state solver of linear-elastic, small-strain deformation
of solid bodies in contact. of solid bodies in contact.
Simple linear elasticity structural analysis code. Simple linear elasticity structural analysis code.

View file

@ -1,4 +1,4 @@
tractionDisplacement/tractionDisplacementFvPatchVectorField.C tractionDisplacement/tractionDisplacementFvPatchVectorField.C
icoFsiFoam.C icoFsiFoam.C
EXE = $(FOAM_APPBIN)/icoFsiFoam EXE = $(FOAM_APPBIN)/icoFsiFoam

View file

@ -1,11 +1,11 @@
{ {
// Setting mesh motion // Setting mesh motion
pointVectorField solidPointsDispl = pointVectorField solidPointsDispl =
cpi.interpolate(Usolid - Usolid.oldTime()); cpi.interpolate(Usolid - Usolid.oldTime());
vectorField newPoints = vectorField newPoints =
stressMesh.points() stressMesh.points()
+ solidPointsDispl.internalField(); + solidPointsDispl.internalField();
stressMesh.movePoints(newPoints); stressMesh.movePoints(newPoints);
@ -28,8 +28,8 @@
# include "volContinuity.H" # include "volContinuity.H"
Info << "Motion magnitude: mean = " Info << "Motion magnitude: mean = "
<< average(mag(Usolid.boundaryField()[solidPatchID])) << average(mag(Usolid.boundaryField()[solidPatchID]))
<< " max = " << " max = "
<< max(mag(Usolid.boundaryField()[solidPatchID])) << endl; << max(mag(Usolid.boundaryField()[solidPatchID])) << endl;
} }

View file

@ -9,7 +9,7 @@
); );
solidPatchPressure *= rhoFluid.value(); solidPatchPressure *= rhoFluid.value();
tForce.pressure() = solidPatchPressure; tForce.pressure() = solidPatchPressure;
@ -20,6 +20,6 @@
mesh.Sf().boundaryField()[fluidPatchID] mesh.Sf().boundaryField()[fluidPatchID]
); );
Info << "Total pressure force = " << totalPressureForce << endl; Info << "Total pressure force = " << totalPressureForce << endl;
} }

View file

@ -16,7 +16,7 @@ $(rheologyLaws)/PronyViscoelastic/PronyViscoelastic.C
thermalModel/thermalModel.C thermalModel/thermalModel.C
thermalLaws = thermalModel/thermalLaws thermalLaws = thermalModel/thermalLaws
$(thermalLaws)/thermalLaw/thermalLaw.C $(thermalLaws)/thermalLaw/thermalLaw.C
$(thermalLaws)/thermalLaw/newThermalLaw.C $(thermalLaws)/thermalLaw/newThermalLaw.C
$(thermalLaws)/constantThermal/constantThermal.C $(thermalLaws)/constantThermal/constantThermal.C
$(thermalLaws)/multiMaterialThermal/multiMaterialThermal.C $(thermalLaws)/multiMaterialThermal/multiMaterialThermal.C

View file

@ -70,7 +70,7 @@ public:
DugdaleCohesiveLaw DugdaleCohesiveLaw
( (
const word& cohesiveLawName, const word& cohesiveLawName,
const dictionary& dict const dictionary& dict
); );
//- Construct as copy //- Construct as copy

View file

@ -73,7 +73,7 @@ Foam::autoPtr<Foam::cohesiveLaw> Foam::cohesiveLaw::New
Foam::cohesiveLaw::cohesiveLaw Foam::cohesiveLaw::cohesiveLaw
( (
const word& cohesiveLawName, const word& cohesiveLawName,
const dictionary& dict const dictionary& dict
) )
: :
cohesiveLawCoeffs_(dict.subDict(cohesiveLawName + "Coeffs")), cohesiveLawCoeffs_(dict.subDict(cohesiveLawName + "Coeffs")),

View file

@ -96,7 +96,7 @@ public:
static autoPtr<cohesiveLaw> New static autoPtr<cohesiveLaw> New
( (
const word& cohesiveLawName, const word& cohesiveLawName,
const dictionary& dict const dictionary& dict
); );
@ -106,7 +106,7 @@ public:
cohesiveLaw cohesiveLaw
( (
const word& cohesiveLawName, const word& cohesiveLawName,
const dictionary& dict const dictionary& dict
); );
//- Construct as copy //- Construct as copy
@ -123,7 +123,7 @@ public:
// Member Functions // Member Functions
//- Return cohesive law coefficients //- Return cohesive law coefficients
const dictionary& cohesiveLawCoeffs() const const dictionary& cohesiveLawCoeffs() const
{ {

View file

@ -70,7 +70,7 @@ public:
linearCohesiveLaw linearCohesiveLaw
( (
const word& cohesiveLawName, const word& cohesiveLawName,
const dictionary& dict const dictionary& dict
); );
//- Construct as copy //- Construct as copy

View file

@ -170,7 +170,7 @@ public:
{ {
checkPatchFace(mesh); checkPatchFace(mesh);
} }
//- Construct from dictionary //- Construct from dictionary
componentReference componentReference

View file

@ -244,7 +244,7 @@ void cohesiveLawFvPatchVectorField::write(Ostream& os) const
{ {
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
traction_.writeEntry("traction", os); traction_.writeEntry("traction", os);
os.writeKeyword("cohesiveLaw") << law().type() os.writeKeyword("cohesiveLaw") << law().type()
<< token::END_STATEMENT << nl; << token::END_STATEMENT << nl;
os.writeKeyword("relaxationFactor") << relaxationFactor_ os.writeKeyword("relaxationFactor") << relaxationFactor_
<< token::END_STATEMENT << nl; << token::END_STATEMENT << nl;

View file

@ -98,7 +98,7 @@ cohesiveZoneFvPatchVectorField::cohesiveZoneFvPatchVectorField
{ {
this->refValue() = vector::zero; this->refValue() = vector::zero;
} }
if (dict.found("refGradient")) if (dict.found("refGradient"))
{ {
this->refGrad() = vectorField("refGradient", dict, p.size()); this->refGrad() = vectorField("refGradient", dict, p.size());
@ -110,7 +110,7 @@ cohesiveZoneFvPatchVectorField::cohesiveZoneFvPatchVectorField
if (dict.found("valueFraction")) if (dict.found("valueFraction"))
{ {
this->valueFraction() = this->valueFraction() =
symmTensorField("valueFraction", dict, p.size()); symmTensorField("valueFraction", dict, p.size());
} }
else else
@ -205,7 +205,7 @@ void cohesiveZoneFvPatchVectorField::updateCoeffs()
const rheologyModel& rheology = const rheologyModel& rheology =
this->db().objectRegistry::lookupObject<rheologyModel>(rheologyName_); this->db().objectRegistry::lookupObject<rheologyModel>(rheologyName_);
const scalarField mu = const scalarField mu =
rheology.mu()().boundaryField()[patch().index()]; rheology.mu()().boundaryField()[patch().index()];
const scalarField lambda = const scalarField lambda =
@ -275,17 +275,17 @@ void cohesiveZoneFvPatchVectorField::updateCoeffs()
if(magSqr(valueFraction()[faceI]) < SMALL) if(magSqr(valueFraction()[faceI]) < SMALL)
{ {
cohesiveTraction = cohesiveTraction =
relaxationFactor_*cohesiveTraction relaxationFactor_*cohesiveTraction
+ (1.0 - relaxationFactor_)*sigmaN[faceI]*n[faceI]; + (1.0 - relaxationFactor_)*sigmaN[faceI]*n[faceI];
refGrad()[faceI] = refGrad()[faceI] =
( (
cohesiveTraction cohesiveTraction
- ( - (
n[faceI] n[faceI]
& ( & (
mu[faceI]*gradU[faceI].T() mu[faceI]*gradU[faceI].T()
- (mu[faceI] + lambda[faceI])*gradU[faceI] - (mu[faceI] + lambda[faceI])*gradU[faceI]
) )
) )
@ -305,7 +305,7 @@ void cohesiveZoneFvPatchVectorField::write(Ostream& os) const
directionMixedFvPatchVectorField::write(os); directionMixedFvPatchVectorField::write(os);
os.writeKeyword("U") << UName_ << token::END_STATEMENT << nl; os.writeKeyword("U") << UName_ << token::END_STATEMENT << nl;
os.writeKeyword("rheology") << rheologyName_ << token::END_STATEMENT << nl; os.writeKeyword("rheology") << rheologyName_ << token::END_STATEMENT << nl;
os.writeKeyword("cohesiveLaw") << law().type() os.writeKeyword("cohesiveLaw") << law().type()
<< token::END_STATEMENT << nl; << token::END_STATEMENT << nl;
os.writeKeyword("relaxationFactor") << relaxationFactor_ os.writeKeyword("relaxationFactor") << relaxationFactor_
<< token::END_STATEMENT << nl; << token::END_STATEMENT << nl;

View file

@ -173,7 +173,7 @@ public:
//- Update the coefficients associated with the patch field //- Update the coefficients associated with the patch field
virtual void updateCoeffs(); virtual void updateCoeffs();
//- Write //- Write
virtual void write(Ostream&) const; virtual void write(Ostream&) const;

View file

@ -106,7 +106,7 @@ Foam::tmp<Foam::volScalarField> Foam::BurgersViscoelastic::E(scalar t) const
+ eta2_.value()/k2_.value(); + eta2_.value()/k2_.value();
scalar p2 = eta1_.value()*eta2_.value()/(k1_.value()*k2_.value()); scalar p2 = eta1_.value()*eta2_.value()/(k1_.value()*k2_.value());
scalar q1 = eta1_.value(); scalar q1 = eta1_.value();
scalar q2 = eta1_.value()*eta2_.value()/k2_.value(); scalar q2 = eta1_.value()*eta2_.value()/k2_.value();
@ -119,7 +119,7 @@ Foam::tmp<Foam::volScalarField> Foam::BurgersViscoelastic::E(scalar t) const
E = (q1 - q2*r1)*exp(-r1*t)/A - (q1 - q2*r2)*exp(-r2*t)/A; E = (q1 - q2*r1)*exp(-r1*t)/A - (q1 - q2*r2)*exp(-r2*t)/A;
} }
tmp<volScalarField> tresult tmp<volScalarField> tresult
( (
@ -177,7 +177,7 @@ Foam::tmp<Foam::volScalarField> Foam::BurgersViscoelastic::J(scalar t) const
if(t >= 0) if(t >= 0)
{ {
J = 1.0/k1_.value() J = 1.0/k1_.value()
+ (1 - exp(-k2_.value()*t/eta2_.value()))/k2_.value() + (1 - exp(-k2_.value()*t/eta2_.value()))/k2_.value()
+ t/eta1_.value(); + t/eta1_.value();
} }

View file

@ -101,14 +101,14 @@ Foam::tmp<Foam::volScalarField> Foam::KelvinSLSViscoelastic::E(scalar t) const
if(t>=0) if(t>=0)
{ {
scalar p1 = eta2_.value()/(k1_.value() + k2_.value()); scalar p1 = eta2_.value()/(k1_.value() + k2_.value());
scalar q0 = k1_.value()*k2_.value()/(k1_.value() + k2_.value()); scalar q0 = k1_.value()*k2_.value()/(k1_.value() + k2_.value());
scalar q1 = k1_.value()*eta2_.value()/(k1_.value() + k2_.value()); scalar q1 = k1_.value()*eta2_.value()/(k1_.value() + k2_.value());
E = q0 + (q1/p1 - q0)*exp(-t/p1); E = q0 + (q1/p1 - q0)*exp(-t/p1);
} }
tmp<volScalarField> tresult tmp<volScalarField> tresult
( (
@ -167,7 +167,7 @@ Foam::tmp<Foam::volScalarField> Foam::KelvinSLSViscoelastic::J(scalar t) const
if(t >= 0) if(t >= 0)
{ {
scalar p1 = eta2_.value()/(k1_.value() + k2_.value()); scalar p1 = eta2_.value()/(k1_.value() + k2_.value());
scalar q0 = k1_.value()*k2_.value()/(k1_.value() + k2_.value()); scalar q0 = k1_.value()*k2_.value()/(k1_.value() + k2_.value());
scalar q1 = k1_.value()*eta2_.value()/(k1_.value() + k2_.value()); scalar q1 = k1_.value()*eta2_.value()/(k1_.value() + k2_.value());

View file

@ -182,8 +182,8 @@ Foam::MaxwellElasticViscoelastic::J(scalar t) const
mesh(), mesh(),
dimensionedScalar dimensionedScalar
( (
"J", "J",
dimless/k_.dimensions(), dimless/k_.dimensions(),
1.0/k_.value() + t/eta_.value() 1.0/k_.value() + t/eta_.value()
), ),
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName

View file

@ -100,7 +100,7 @@ Foam::tmp<Foam::volScalarField> Foam::MaxwellSLSViscoelastic::E(scalar t) const
{ {
E = k2_.value() + k1_.value()*exp(-k1_.value()*t/eta1_.value()); E = k2_.value() + k1_.value()*exp(-k1_.value()*t/eta1_.value());
} }
tmp<volScalarField> tresult tmp<volScalarField> tresult
( (

View file

@ -168,8 +168,8 @@ Foam::tmp<Foam::volScalarField> Foam::MaxwellViscoelastic::J(scalar t) const
mesh(), mesh(),
dimensionedScalar dimensionedScalar
( (
"J", "J",
dimless/k_.dimensions(), dimless/k_.dimensions(),
1.0/k_.value() + t/eta_.value() 1.0/k_.value() + t/eta_.value()
), ),
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName

View file

@ -104,7 +104,7 @@ Foam::tmp<Foam::volScalarField> Foam::PronyViscoelastic::E(scalar t) const
{ {
E += k_[i]*exp(-t/tau_[i]); E += k_[i]*exp(-t/tau_[i]);
} }
if(t < 0) if(t < 0)
{ {
E = 0; E = 0;
@ -161,7 +161,7 @@ Foam::tmp<Foam::volScalarField> Foam::PronyViscoelastic::nu(scalar t) const
Foam::tmp<Foam::volScalarField> Foam::PronyViscoelastic::J(scalar t) const Foam::tmp<Foam::volScalarField> Foam::PronyViscoelastic::J(scalar t) const
{ {
notImplemented(type() + "::J(scalar t)"); notImplemented(type() + "::J(scalar t)");
return 1.0/E(t); return 1.0/E(t);
} }

View file

@ -103,7 +103,7 @@ Foam::contactPatchPair::contactPatchPair
cp.mesh().boundaryMesh()[slavePatch_.index()], // to patch cp.mesh().boundaryMesh()[slavePatch_.index()], // to patch
intersection::algorithmNames_.read(dict.lookup("projectionAlgo")), intersection::algorithmNames_.read(dict.lookup("projectionAlgo")),
intersection::directionNames_.read(dict.lookup("projectionDir")) intersection::directionNames_.read(dict.lookup("projectionDir"))
), ),
slaveToMasterInterpolate_ slaveToMasterInterpolate_
( (
@ -111,7 +111,7 @@ Foam::contactPatchPair::contactPatchPair
cp.mesh().boundaryMesh()[masterPatch_.index()], // to patch cp.mesh().boundaryMesh()[masterPatch_.index()], // to patch
intersection::algorithmNames_.read(dict.lookup("projectionAlgo")), intersection::algorithmNames_.read(dict.lookup("projectionAlgo")),
intersection::directionNames_.read(dict.lookup("projectionDir")) intersection::directionNames_.read(dict.lookup("projectionDir"))
) )
{} {}

View file

@ -26,7 +26,7 @@ Class
Description Description
A pair of surfaces in contact. A pair of surfaces in contact.
SourceFiles SourceFiles
contactPatchPair.C contactPatchPair.C

View file

@ -240,7 +240,7 @@ void contactProblem::correct()
( (
lambdaPatches[patchI]*tr(gradUpatches[patchI]) lambdaPatches[patchI]*tr(gradUpatches[patchI])
) )
)/(2.0*muPatches[patchI] + lambdaPatches[patchI]); )/(2.0*muPatches[patchI] + lambdaPatches[patchI]);
// Set the value fractions // Set the value fractions

View file

@ -176,7 +176,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
gradient() = gradient() =
( (
(traction_ + pressure_*n)/rho.value() (traction_ + pressure_*n)/rho.value()
+ twoMuLambda*fvPatchField<vector>::snGrad() - (n & sigmaD) + twoMuLambda*fvPatchField<vector>::snGrad() - (n & sigmaD)
)/twoMuLambda; )/twoMuLambda;
Switch thermalStress(thermalProperties.lookup("thermalStress")); Switch thermalStress(thermalProperties.lookup("thermalStress"));
@ -186,7 +186,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
dimensionedScalar alpha(thermalProperties.lookup("alpha")); dimensionedScalar alpha(thermalProperties.lookup("alpha"));
dimensionedScalar threeKalpha = threeK*alpha; dimensionedScalar threeKalpha = threeK*alpha;
const fvPatchField<scalar>& T = const fvPatchField<scalar>& T =
patch().lookupPatchField<volScalarField, scalar>("T"); patch().lookupPatchField<volScalarField, scalar>("T");
gradient() += n*threeKalpha.value()*T/twoMuLambda; gradient() += n*threeKalpha.value()*T/twoMuLambda;

View file

@ -71,7 +71,7 @@ int main(int argc, char *argv[])
{ {
volTensorField gradDcorr = fvc::grad(Dcorr); volTensorField gradDcorr = fvc::grad(Dcorr);
sigmaExp = sigmaExp =
(lambda - mu)*gradDcorr + mu*gradDcorr.T() (lambda - mu)*gradDcorr + mu*gradDcorr.T()
+ (lambda*I)*tr(gradDcorr); + (lambda*I)*tr(gradDcorr);

View file

@ -170,7 +170,7 @@ void tractionDisplacementCorrectionFvPatchVectorField::updateCoeffs()
const fvPatchField<symmTensor>& sigmaD = const fvPatchField<symmTensor>& sigmaD =
patch().lookupPatchField<volSymmTensorField, symmTensor>("sigmaD"); patch().lookupPatchField<volSymmTensorField, symmTensor>("sigmaD");
const fvPatchField<tensor>& sigmaExp = const fvPatchField<tensor>& sigmaExp =
patch().lookupPatchField<volTensorField, tensor>("sigmaExp"); patch().lookupPatchField<volTensorField, tensor>("sigmaExp");
gradient() = gradient() =

View file

@ -54,7 +54,7 @@ int main(int argc, char *argv[])
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nCalculating displacement field\n" << endl; Info<< "\nCalculating displacement field\n" << endl;
for (runTime++; !runTime.end(); runTime++) for (runTime++; !runTime.end(); runTime++)
{ {
Info<< "Iteration: " << runTime.timeName() << nl << endl; Info<< "Iteration: " << runTime.timeName() << nl << endl;

View file

@ -1,4 +1,4 @@
// aitken acceleration // aitken acceleration
aitkenDelta.storePrevIter(); aitkenDelta.storePrevIter();
// update delta // update delta

View file

@ -7,7 +7,7 @@ if(divSigmaExpMethod == "standard")
); );
} }
else if(divSigmaExpMethod == "surface") else if(divSigmaExpMethod == "surface")
{ {
divSigmaExp = fvc::div divSigmaExp = fvc::div
( (
muf*(mesh.Sf() & fvc::interpolate(gradU.T())) muf*(mesh.Sf() & fvc::interpolate(gradU.T()))
@ -21,7 +21,7 @@ if(divSigmaExpMethod == "standard")
surfaceTensorField shearGradU = surfaceTensorField shearGradU =
((I - n*n)&fvc::interpolate(gradU)); ((I - n*n)&fvc::interpolate(gradU));
divSigmaExp = fvc::div divSigmaExp = fvc::div
( (
mesh.magSf() mesh.magSf()

View file

@ -3,7 +3,7 @@
// traction = (n&fvc::interpolate(sigma)); // traction = (n&fvc::interpolate(sigma));
// surfaceTensorField sGradU = // surfaceTensorField sGradU =
// ((I - n*n)&fvc::interpolate(gradU)); // ((I - n*n)&fvc::interpolate(gradU));
// traction = // traction =

View file

@ -7,7 +7,7 @@
Cczm[i] -= Cczm[sizeByTwo + i]; Cczm[i] -= Cczm[sizeByTwo + i];
Cczm[sizeByTwo + i] = Cczm[i]; Cczm[sizeByTwo + i] = Cczm[i];
} }
scalar error = sum(mag(Cczm)); scalar error = sum(mag(Cczm));
if(error < SMALL) if(error < SMALL)
@ -16,7 +16,7 @@
} }
else else
{ {
Info << "Cohesive patch face ordering: error (" << error << ")" Info << "Cohesive patch face ordering: error (" << error << ")"
<< endl; << endl;
} }
} }

View file

@ -42,7 +42,7 @@
// ( // (
// U.boundaryField()[cohesivePatchID] // U.boundaryField()[cohesivePatchID]
// ); // );
// philipc: I have moved cohesive stuff to constitutiveModel // philipc: I have moved cohesive stuff to constitutiveModel
// cohesiveZone is an index field // cohesiveZone is an index field
@ -67,18 +67,18 @@
{ {
const dictionary& stressControl = const dictionary& stressControl =
mesh.solutionDict().subDict("solidMechanics"); mesh.solutionDict().subDict("solidMechanics");
List<boundBox> userBoxes(stressControl.lookup("crackLimitingBoxes")); List<boundBox> userBoxes(stressControl.lookup("crackLimitingBoxes"));
const surfaceVectorField& Cf = mesh.Cf(); const surfaceVectorField& Cf = mesh.Cf();
forAll(cohesiveZone.internalField(), faceI) forAll(cohesiveZone.internalField(), faceI)
{ {
bool faceInsideBox = false; bool faceInsideBox = false;
forAll(userBoxes, boxi) forAll(userBoxes, boxi)
{ {
if(userBoxes[boxi].contains(Cf.internalField()[faceI])) faceInsideBox = true; if(userBoxes[boxi].contains(Cf.internalField()[faceI])) faceInsideBox = true;
} }
if(faceInsideBox) if(faceInsideBox)
{ {
cohesiveZone.internalField()[faceI] = 1.0; cohesiveZone.internalField()[faceI] = 1.0;
@ -93,12 +93,12 @@
forAll(cohesiveZone.boundaryField()[patchI], faceI) forAll(cohesiveZone.boundaryField()[patchI], faceI)
{ {
bool faceInsideBox = false; bool faceInsideBox = false;
forAll(userBoxes, boxi) forAll(userBoxes, boxi)
{ {
if(userBoxes[boxi].contains(Cf.boundaryField()[patchI][faceI])) faceInsideBox = true; if(userBoxes[boxi].contains(Cf.boundaryField()[patchI][faceI])) faceInsideBox = true;
} }
if(faceInsideBox) if(faceInsideBox)
{ {
cohesiveZone.boundaryField()[patchI][faceI] = 1.0; cohesiveZone.boundaryField()[patchI][faceI] = 1.0;
@ -149,7 +149,7 @@
Switch initialiseSolution(false); Switch initialiseSolution(false);
if if
( (
mesh.solutionDict().subDict("solidMechanics") mesh.solutionDict().subDict("solidMechanics")
.found("initialiseSolution") .found("initialiseSolution")
@ -168,7 +168,7 @@
Switch breakOnlyOneFacePerTopologyChange(true); Switch breakOnlyOneFacePerTopologyChange(true);
if if
( (
mesh.solutionDict().subDict("solidMechanics") mesh.solutionDict().subDict("solidMechanics")
.found("breakOnlyOneFacePerTopologyChange") .found("breakOnlyOneFacePerTopologyChange")

View file

@ -95,7 +95,7 @@
); );
constitutiveModel rheology(sigma, U); constitutiveModel rheology(sigma, U);
surfaceVectorField traction surfaceVectorField traction
( (
IOobject IOobject

View file

@ -4,10 +4,10 @@
{ {
if (needRef[regI]) if (needRef[regI])
{ {
UEqn.source()[refCells[regI]] += UEqn.source()[refCells[regI]] +=
UEqn.diag()[refCells[regI]]*vector::zero; UEqn.diag()[refCells[regI]]*vector::zero;
UEqn.diag()[refCells[regI]] += UEqn.diag()[refCells[regI]] +=
UEqn.diag()[refCells[regI]]; UEqn.diag()[refCells[regI]];
} }
} }

View file

@ -3,7 +3,7 @@ nCoupledFacesToBreak = 0;
{ {
// Check internal faces // Check internal faces
// scalarField effTraction = // scalarField effTraction =
// cohesiveZone.internalField() * // cohesiveZone.internalField() *
// mag(traction.internalField()); // mag(traction.internalField());
scalarField normalTraction = scalarField normalTraction =
@ -13,7 +13,7 @@ nCoupledFacesToBreak = 0;
scalarField shearTraction = scalarField shearTraction =
cohesiveZone.internalField() * cohesiveZone.internalField() *
mag( (I - Foam::sqr(n.internalField())) & traction.internalField() ); mag( (I - Foam::sqr(n.internalField())) & traction.internalField() );
// the traction fraction is monitored to decide which faces to break: // the traction fraction is monitored to decide which faces to break:
// ie (tN/tNC)^2 + (tS/tSC)^2 >1 to crack a face // ie (tN/tNC)^2 + (tS/tSC)^2 >1 to crack a face
@ -25,7 +25,7 @@ nCoupledFacesToBreak = 0;
//scalarField effTractionFraction = effTraction/sigmaMax; //scalarField effTractionFraction = effTraction/sigmaMax;
scalarField effTractionFraction(normalTraction.size(), 0.0); scalarField effTractionFraction(normalTraction.size(), 0.0);
if(cohesivePatchUPtr) if(cohesivePatchUPtr)
{ {
effTractionFraction = effTractionFraction =
@ -74,7 +74,7 @@ nCoupledFacesToBreak = 0;
} }
} }
scalar gMaxEffTractionFraction = scalar gMaxEffTractionFraction =
returnReduce(faceToBreakEffTractionFraction, maxOp<scalar>()); returnReduce(faceToBreakEffTractionFraction, maxOp<scalar>());
if (Pstream::parRun()) if (Pstream::parRun())
@ -114,7 +114,7 @@ nCoupledFacesToBreak = 0;
{ {
if (mesh.boundary()[patchI].coupled()) if (mesh.boundary()[patchI].coupled())
{ {
// scalarField pEffTraction = // scalarField pEffTraction =
// cohesiveZone.boundaryField()[patchI] * // cohesiveZone.boundaryField()[patchI] *
// mag(traction.boundaryField()[patchI]); // mag(traction.boundaryField()[patchI]);
// scalarField pEffTractionFraction = pEffTraction/sigmaMax.boundaryField()[patchI]; // scalarField pEffTractionFraction = pEffTraction/sigmaMax.boundaryField()[patchI];
@ -126,12 +126,12 @@ nCoupledFacesToBreak = 0;
scalarField pShearTraction = scalarField pShearTraction =
cohesiveZone.boundaryField()[patchI] * cohesiveZone.boundaryField()[patchI] *
mag( (I - Foam::sqr(n.boundaryField()[patchI])) & traction.boundaryField()[patchI] ); mag( (I - Foam::sqr(n.boundaryField()[patchI])) & traction.boundaryField()[patchI] );
// the traction fraction is monitored to decide which faces to break: // the traction fraction is monitored to decide which faces to break:
// ie (tN/tNC)^2 + (tS/tSC)^2 >1 to crack a face // ie (tN/tNC)^2 + (tS/tSC)^2 >1 to crack a face
const scalarField& pSigmaMax = sigmaMax.boundaryField()[patchI]; const scalarField& pSigmaMax = sigmaMax.boundaryField()[patchI];
const scalarField& pTauMax = tauMax.boundaryField()[patchI]; const scalarField& pTauMax = tauMax.boundaryField()[patchI];
scalarField pEffTractionFraction(pNormalTraction.size(), 0.0); scalarField pEffTractionFraction(pNormalTraction.size(), 0.0);
if(cohesivePatchUPtr) if(cohesivePatchUPtr)
{ {
@ -153,7 +153,7 @@ nCoupledFacesToBreak = 0;
{ {
maxEffTractionFraction = pEffTractionFraction[faceI]; maxEffTractionFraction = pEffTractionFraction[faceI];
} }
if (pEffTractionFraction[faceI] > 1.0) if (pEffTractionFraction[faceI] > 1.0)
{ {
coupledFacesToBreakList.insert(start + faceI); coupledFacesToBreakList.insert(start + faceI);
@ -162,7 +162,7 @@ nCoupledFacesToBreak = 0;
pEffTractionFraction[faceI] pEffTractionFraction[faceI]
); );
} }
} }
} }
} }
@ -185,19 +185,19 @@ nCoupledFacesToBreak = 0;
scalar coupledFaceToBreakEffTractionFraction = 0; scalar coupledFaceToBreakEffTractionFraction = 0;
forAll(coupledFacesToBreakEffTractionFraction, faceI) forAll(coupledFacesToBreakEffTractionFraction, faceI)
{ {
if if
( (
coupledFacesToBreakEffTractionFraction[faceI] coupledFacesToBreakEffTractionFraction[faceI]
> coupledFaceToBreakEffTractionFraction > coupledFaceToBreakEffTractionFraction
) )
{ {
coupledFaceToBreakEffTractionFraction = coupledFaceToBreakEffTractionFraction =
coupledFacesToBreakEffTractionFraction[faceI]; coupledFacesToBreakEffTractionFraction[faceI];
coupledFaceToBreakIndex = coupledFacesToBreak[faceI]; coupledFaceToBreakIndex = coupledFacesToBreak[faceI];
} }
} }
scalar gMaxCoupledEffTractionFraction = scalar gMaxCoupledEffTractionFraction =
returnReduce(coupledFaceToBreakEffTractionFraction, maxOp<scalar>()); returnReduce(coupledFaceToBreakEffTractionFraction, maxOp<scalar>());
if (Pstream::parRun()) if (Pstream::parRun())
@ -208,8 +208,8 @@ nCoupledFacesToBreak = 0;
{ {
if if
( (
mag(gMaxCoupledEffTractionFraction - coupledFaceToBreakEffTractionFraction) mag(gMaxCoupledEffTractionFraction - coupledFaceToBreakEffTractionFraction)
< SMALL < SMALL
) )
{ {
// Maximum traction fraction is on this processor // Maximum traction fraction is on this processor
@ -226,11 +226,11 @@ nCoupledFacesToBreak = 0;
label minProcID = label minProcID =
returnReduce<label>(procID, minOp<label>()); returnReduce<label>(procID, minOp<label>());
if (procID != minProcID) if (procID != minProcID)
{ {
nCoupledFacesToBreak = 0; nCoupledFacesToBreak = 0;
} }
} }
if (gMaxCoupledEffTractionFraction > gMaxEffTractionFraction) if (gMaxCoupledEffTractionFraction > gMaxEffTractionFraction)
@ -249,7 +249,7 @@ nCoupledFacesToBreak = 0;
labelList index(Pstream::nProcs(), -1); labelList index(Pstream::nProcs(), -1);
if (nCoupledFacesToBreak) if (nCoupledFacesToBreak)
{ {
label patchID = label patchID =
mesh.boundaryMesh().whichPatch(coupledFaceToBreakIndex); mesh.boundaryMesh().whichPatch(coupledFaceToBreakIndex);
label start = mesh.boundaryMesh()[patchID].start(); label start = mesh.boundaryMesh()[patchID].start();
@ -288,10 +288,10 @@ nCoupledFacesToBreak = 0;
mesh.boundaryMesh()[patchI] mesh.boundaryMesh()[patchI]
); );
label ngbProcNo = procPatch.neighbProcNo(); label ngbProcNo = procPatch.neighbProcNo();
if (ngbProcNo == procI) if (ngbProcNo == procI)
{ {
label start = label start =
mesh.boundaryMesh()[patchI].start(); mesh.boundaryMesh()[patchI].start();
coupledFaceToBreakIndex = start + index[procI]; coupledFaceToBreakIndex = start + index[procI];
nCoupledFacesToBreak = 1; nCoupledFacesToBreak = 1;
@ -345,14 +345,14 @@ nCoupledFacesToBreak = 0;
} }
else if (nCoupledFacesToBreak > 0) else if (nCoupledFacesToBreak > 0)
{ {
label patchID = label patchID =
mesh.boundaryMesh().whichPatch(coupledFaceToBreakIndex); mesh.boundaryMesh().whichPatch(coupledFaceToBreakIndex);
label start = mesh.boundaryMesh()[patchID].start(); label start = mesh.boundaryMesh()[patchID].start();
label localIndex = coupledFaceToBreakIndex - start; label localIndex = coupledFaceToBreakIndex - start;
faceToBreakTraction = traction.boundaryField()[patchID][localIndex]; faceToBreakTraction = traction.boundaryField()[patchID][localIndex];
faceToBreakNormal = n.boundaryField()[patchID][localIndex]; faceToBreakNormal = n.boundaryField()[patchID][localIndex];
// Scale broken face traction // Scale broken face traction
faceToBreakSigmaMax = sigmaMax.boundaryField()[patchID][localIndex]; faceToBreakSigmaMax = sigmaMax.boundaryField()[patchID][localIndex];
faceToBreakTauMax = tauMax.boundaryField()[patchID][localIndex]; faceToBreakTauMax = tauMax.boundaryField()[patchID][localIndex];
@ -428,11 +428,11 @@ nCoupledFacesToBreak = 0;
} }
// Local crack displacement // Local crack displacement
vectorField UpI = vectorField UpI =
U.boundaryField()[cohesivePatchID].patchInternalField(); U.boundaryField()[cohesivePatchID].patchInternalField();
vectorField oldUpI = vectorField oldUpI =
U.oldTime().boundaryField()[cohesivePatchID].patchInternalField(); U.oldTime().boundaryField()[cohesivePatchID].patchInternalField();
// Global crack displacement // Global crack displacement
vectorField globalUpI = mesh.globalCrackField(UpI); vectorField globalUpI = mesh.globalCrackField(UpI);
vectorField globalOldUpI = mesh.globalCrackField(oldUpI); vectorField globalOldUpI = mesh.globalCrackField(oldUpI);
@ -445,7 +445,7 @@ nCoupledFacesToBreak = 0;
// cohesivePatchU.size() // cohesivePatchU.size()
int cohesivePatchSize(cohesivePatchUPtr ? cohesivePatchUPtr->size() : cohesivePatchUFixedModePtr->size()); int cohesivePatchSize(cohesivePatchUPtr ? cohesivePatchUPtr->size() : cohesivePatchUFixedModePtr->size());
// Initialise U for new cohesive face // Initialise U for new cohesive face
const labelList& gcfa = mesh.globalCrackFaceAddressing(); const labelList& gcfa = mesh.globalCrackFaceAddressing();
label globalIndex = mesh.localCrackStart(); label globalIndex = mesh.localCrackStart();
@ -460,13 +460,13 @@ nCoupledFacesToBreak = 0;
U.boundaryField()[cohesivePatchID][i] = U.boundaryField()[cohesivePatchID][i] =
0.5 0.5
*( *(
globalUpI[globalIndex] globalUpI[globalIndex]
+ globalUpI[gcfa[globalIndex]] + globalUpI[gcfa[globalIndex]]
); );
U.oldTime().boundaryField()[cohesivePatchID][i] = U.oldTime().boundaryField()[cohesivePatchID][i] =
0.5 0.5
*( *(
globalOldUpI[globalIndex] globalOldUpI[globalIndex]
+ globalOldUpI[gcfa[globalIndex]] + globalOldUpI[gcfa[globalIndex]]
); );
@ -499,7 +499,7 @@ nCoupledFacesToBreak = 0;
# include "calculateTraction.H" # include "calculateTraction.H"
//if (nFacesToBreak || nCoupledFacesToBreak) mesh.write(); traction.write(); //if (nFacesToBreak || nCoupledFacesToBreak) mesh.write(); traction.write();
// Initialise initiation traction for new cohesive patch face // Initialise initiation traction for new cohesive patch face
// for (label i=0; i<cohesivePatchU.size(); i++) // for (label i=0; i<cohesivePatchU.size(); i++)
for (label i=0; i<cohesivePatchSize; i++) for (label i=0; i<cohesivePatchSize; i++)
{ {
@ -512,7 +512,7 @@ nCoupledFacesToBreak = 0;
|| (oldFaceIndex == coupledFaceToBreakIndex) || (oldFaceIndex == coupledFaceToBreakIndex)
) )
{ {
vector n0 = vector n0 =
mesh.Sf().boundaryField()[cohesivePatchID][i] mesh.Sf().boundaryField()[cohesivePatchID][i]
/mesh.magSf().boundaryField()[cohesivePatchID][i]; /mesh.magSf().boundaryField()[cohesivePatchID][i];
//vector n1 = -n0; //vector n1 = -n0;

View file

@ -140,7 +140,7 @@ if (runTime.outputTime() || topoChange)
GII.boundaryField()[patchi] = Upatch.GII(); GII.boundaryField()[patchi] = Upatch.GII();
damageAndCracks.boundaryField()[patchi] = Upatch.crackingAndDamage(); damageAndCracks.boundaryField()[patchi] = Upatch.crackingAndDamage();
} }
} }
volScalarField GTotal("GTotal", GI + GII); volScalarField GTotal("GTotal", GI + GII);
GTotal.write(); GTotal.write();

View file

@ -6,15 +6,15 @@ if(historyPatchID != -1)
//- for small strain or moving mesh //- for small strain or moving mesh
vector force = gSum(mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]); vector force = gSum(mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]);
//- for large strain total lagrangian //- for large strain total lagrangian
// tensorField F = I + gradU.boundaryField()[historyPatchID]; // tensorField F = I + gradU.boundaryField()[historyPatchID];
// vectorField totalForce = mesh.Sf().boundaryField()[historyPatchID] & (sigma.boundaryField()[historyPatchID] & F); // vectorField totalForce = mesh.Sf().boundaryField()[historyPatchID] & (sigma.boundaryField()[historyPatchID] & F);
//vector force = sum( totalForce ); //vector force = sum( totalForce );
//scalar force = force[vector::Y]; //scalar force = force[vector::Y];
//- patchIntegrate utility integrates it this way but this is worng because the sigma tensor should //- patchIntegrate utility integrates it this way but this is worng because the sigma tensor should
//- be dotted with the surface normal to give the actual traction/force //- be dotted with the surface normal to give the actual traction/force
//- you cannot just take the component of the sigma tensor //- you cannot just take the component of the sigma tensor
@ -22,9 +22,9 @@ if(historyPatchID != -1)
// mesh.magSf().boundaryField()[historyPatchID] // mesh.magSf().boundaryField()[historyPatchID]
// *sigma.boundaryField()[historyPatchID].component(symmTensor::XY) // *sigma.boundaryField()[historyPatchID].component(symmTensor::XY)
// ); // );
vector avDisp = gAverage(U.boundaryField()[historyPatchID]); vector avDisp = gAverage(U.boundaryField()[historyPatchID]);
//- write to file //- write to file
if(Pstream::master()) if(Pstream::master())
{ {

View file

@ -1,4 +1,4 @@
// aitken acceleration // aitken acceleration
aitkenDelta.storePrevIter(); aitkenDelta.storePrevIter();
// update delta // update delta

View file

@ -7,7 +7,7 @@ if(divDSigmaExpMethod == "standard")
); );
} }
else if(divDSigmaExpMethod == "surface") else if(divDSigmaExpMethod == "surface")
{ {
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
muf*(mesh.Sf() & fvc::interpolate(gradDU.T())) muf*(mesh.Sf() & fvc::interpolate(gradDU.T()))
@ -21,7 +21,7 @@ if(divDSigmaExpMethod == "standard")
surfaceTensorField shearGradDU = surfaceTensorField shearGradDU =
((I - n*n)&fvc::interpolate(gradDU)); ((I - n*n)&fvc::interpolate(gradDU));
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
mesh.magSf() mesh.magSf()

View file

@ -3,7 +3,7 @@
// traction = (n&fvc::interpolate(sigma)); // traction = (n&fvc::interpolate(sigma));
// surfaceTensorField sGradU = // surfaceTensorField sGradU =
// ((I - n*n)&fvc::interpolate(gradU)); // ((I - n*n)&fvc::interpolate(gradU));
// traction = // traction =

View file

@ -7,7 +7,7 @@
Cczm[i] -= Cczm[sizeByTwo + i]; Cczm[i] -= Cczm[sizeByTwo + i];
Cczm[sizeByTwo + i] = Cczm[i]; Cczm[sizeByTwo + i] = Cczm[i];
} }
scalar error = sum(mag(Cczm)); scalar error = sum(mag(Cczm));
if(error < SMALL) if(error < SMALL)
@ -16,7 +16,7 @@
} }
else else
{ {
Info << "Cohesive patch face ordering: error (" << error << ")" Info << "Cohesive patch face ordering: error (" << error << ")"
<< endl; << endl;
} }
} }

View file

@ -67,19 +67,19 @@
{ {
const dictionary& stressControl = const dictionary& stressControl =
mesh.solutionDict().subDict("solidMechanics"); mesh.solutionDict().subDict("solidMechanics");
List<boundBox> userBoxes(stressControl.lookup("crackLimitingBoxes")); List<boundBox> userBoxes(stressControl.lookup("crackLimitingBoxes"));
const surfaceVectorField& Cf = mesh.Cf(); const surfaceVectorField& Cf = mesh.Cf();
//int numPossibleCrackFaces = 0; //int numPossibleCrackFaces = 0;
forAll(cohesiveZone.internalField(), faceI) forAll(cohesiveZone.internalField(), faceI)
{ {
bool faceInsideBox = false; bool faceInsideBox = false;
forAll(userBoxes, boxi) forAll(userBoxes, boxi)
{ {
if(userBoxes[boxi].contains(Cf.internalField()[faceI])) faceInsideBox = true; if(userBoxes[boxi].contains(Cf.internalField()[faceI])) faceInsideBox = true;
} }
if(faceInsideBox) if(faceInsideBox)
{ {
cohesiveZone.internalField()[faceI] = 1.0; cohesiveZone.internalField()[faceI] = 1.0;
@ -96,18 +96,18 @@
forAll(cohesiveZone.boundaryField()[patchI], faceI) forAll(cohesiveZone.boundaryField()[patchI], faceI)
{ {
bool faceInsideBox = false; bool faceInsideBox = false;
forAll(userBoxes, boxi) forAll(userBoxes, boxi)
{ {
if(userBoxes[boxi].contains(Cf.boundaryField()[patchI][faceI])) faceInsideBox = true; if(userBoxes[boxi].contains(Cf.boundaryField()[patchI][faceI])) faceInsideBox = true;
} }
if(faceInsideBox) if(faceInsideBox)
{ {
cohesiveZone.boundaryField()[patchI][faceI] = 1.0; cohesiveZone.boundaryField()[patchI][faceI] = 1.0;
} }
} }
// numPossibleCrackFaces += int(sum(cohesiveZone.boundaryField()[patchI])); // numPossibleCrackFaces += int(sum(cohesiveZone.boundaryField()[patchI]));
// philipc multiMat cracks not working on proc boundaries yet... disable for now // philipc multiMat cracks not working on proc boundaries yet... disable for now
// found the problem: solidInterface needs to know about mesh changes so // found the problem: solidInterface needs to know about mesh changes so
@ -168,7 +168,7 @@
Switch initialiseSolution(false); Switch initialiseSolution(false);
if if
( (
mesh.solutionDict().subDict("solidMechanics") mesh.solutionDict().subDict("solidMechanics")
.found("initialiseSolution") .found("initialiseSolution")
@ -187,7 +187,7 @@
Switch breakOnlyOneFacePerTopologyChange(true); Switch breakOnlyOneFacePerTopologyChange(true);
if if
( (
mesh.solutionDict().subDict("solidMechanics") mesh.solutionDict().subDict("solidMechanics")
.found("breakOnlyOneFacePerTopologyChange") .found("breakOnlyOneFacePerTopologyChange")

View file

@ -15,7 +15,7 @@ scalar deltaTmin(readScalar(stressControl.lookup("deltaTmin")));
scalar deltaTmax(readScalar(stressControl.lookup("deltaTmax"))); scalar deltaTmax(readScalar(stressControl.lookup("deltaTmax")));
int infoFrequency(readInt(stressControl.lookup("infoFrequency"))); int infoFrequency(readInt(stressControl.lookup("infoFrequency")));
//Info << "\nFrequency of info statements is " << infoFrequency << endl; //Info << "\nFrequency of info statements is " << infoFrequency << endl;
Switch aitkenRelax(stressControl.lookup("aitkenRelaxation")); Switch aitkenRelax(stressControl.lookup("aitkenRelaxation"));
Switch predictor(stressControl.lookup("predictor")); Switch predictor(stressControl.lookup("predictor"));

View file

@ -4,10 +4,10 @@
{ {
if (needRef[regI]) if (needRef[regI])
{ {
UEqn.source()[refCells[regI]] += UEqn.source()[refCells[regI]] +=
UEqn.diag()[refCells[regI]]*vector::zero; UEqn.diag()[refCells[regI]]*vector::zero;
UEqn.diag()[refCells[regI]] += UEqn.diag()[refCells[regI]] +=
UEqn.diag()[refCells[regI]]; UEqn.diag()[refCells[regI]];
} }
} }

View file

@ -3,7 +3,7 @@ nCoupledFacesToBreak = 0;
{ {
// Check internal faces // Check internal faces
// scalarField effTraction = // scalarField effTraction =
// cohesiveZone.internalField() * // cohesiveZone.internalField() *
// mag(traction.internalField()); // mag(traction.internalField());
scalarField normalTraction = scalarField normalTraction =
@ -26,7 +26,7 @@ nCoupledFacesToBreak = 0;
// scalarField effTractionFraction = // scalarField effTractionFraction =
// (normalTraction/sigmaMaxI)*(normalTraction/sigmaMaxI) + (shearTraction/tauMaxI)*(shearTraction/tauMaxI); // (normalTraction/sigmaMaxI)*(normalTraction/sigmaMaxI) + (shearTraction/tauMaxI)*(shearTraction/tauMaxI);
scalarField effTractionFraction(normalTraction.size(), 0.0); scalarField effTractionFraction(normalTraction.size(), 0.0);
if(cohesivePatchDUPtr) if(cohesivePatchDUPtr)
{ {
effTractionFraction = effTractionFraction =
@ -75,7 +75,7 @@ nCoupledFacesToBreak = 0;
faceToBreakIndex = facesToBreak[faceI]; faceToBreakIndex = facesToBreak[faceI];
} }
} }
scalar gMaxEffTractionFraction = scalar gMaxEffTractionFraction =
returnReduce(faceToBreakEffTractionFraction, maxOp<scalar>()); returnReduce(faceToBreakEffTractionFraction, maxOp<scalar>());
if (Pstream::parRun()) if (Pstream::parRun())
@ -91,7 +91,7 @@ nCoupledFacesToBreak = 0;
} }
// Check if maximum is present on more then one processors // Check if maximum is present on more then one processors
label procID = Pstream::nProcs(); label procID = Pstream::nProcs();
if (procHasFaceToBreak) if (procHasFaceToBreak)
{ {
@ -117,7 +117,7 @@ nCoupledFacesToBreak = 0;
{ {
if (mesh.boundary()[patchI].coupled()) if (mesh.boundary()[patchI].coupled())
{ {
// scalarField pEffTraction = // scalarField pEffTraction =
// cohesiveZone.boundaryField()[patchI] * // cohesiveZone.boundaryField()[patchI] *
// mag(traction.boundaryField()[patchI]); // mag(traction.boundaryField()[patchI]);
// scalarField pEffTractionFraction = pEffTraction/sigmaMax.boundaryField()[patchI]; // scalarField pEffTractionFraction = pEffTraction/sigmaMax.boundaryField()[patchI];
@ -129,12 +129,12 @@ nCoupledFacesToBreak = 0;
scalarField pShearTraction = scalarField pShearTraction =
cohesiveZone.boundaryField()[patchI] * cohesiveZone.boundaryField()[patchI] *
mag( (I - Foam::sqr(n.boundaryField()[patchI])) & traction.boundaryField()[patchI] ); mag( (I - Foam::sqr(n.boundaryField()[patchI])) & traction.boundaryField()[patchI] );
// the traction fraction is monitored to decide which faces to break: // the traction fraction is monitored to decide which faces to break:
// ie (tN/tNC)^2 + (tS/tSC)^2 >1 to crack a face // ie (tN/tNC)^2 + (tS/tSC)^2 >1 to crack a face
const scalarField& pSigmaMax = sigmaMax.boundaryField()[patchI]; const scalarField& pSigmaMax = sigmaMax.boundaryField()[patchI];
const scalarField& pTauMax = tauMax.boundaryField()[patchI]; const scalarField& pTauMax = tauMax.boundaryField()[patchI];
// scalarField pEffTractionFraction = // scalarField pEffTractionFraction =
// (pNormalTraction/pSigmaMax)*(pNormalTraction/pSigmaMax) + (pShearTraction/pTauMax)*(pShearTraction/pTauMax); // (pNormalTraction/pSigmaMax)*(pNormalTraction/pSigmaMax) + (pShearTraction/pTauMax)*(pShearTraction/pTauMax);
scalarField pEffTractionFraction(pNormalTraction.size(), 0.0); scalarField pEffTractionFraction(pNormalTraction.size(), 0.0);
@ -158,7 +158,7 @@ nCoupledFacesToBreak = 0;
{ {
maxEffTractionFraction = pEffTractionFraction[faceI]; maxEffTractionFraction = pEffTractionFraction[faceI];
} }
if (pEffTractionFraction[faceI] > 1.0) if (pEffTractionFraction[faceI] > 1.0)
{ {
//Pout << "coupled face to break " << faceI << endl; //Pout << "coupled face to break " << faceI << endl;
@ -168,7 +168,7 @@ nCoupledFacesToBreak = 0;
pEffTractionFraction[faceI] pEffTractionFraction[faceI]
); );
} }
} }
} }
} }
@ -186,26 +186,26 @@ nCoupledFacesToBreak = 0;
{ {
nCoupledFacesToBreak = 1; nCoupledFacesToBreak = 1;
} }
// Select coupled face with maximum effective traction fraction // Select coupled face with maximum effective traction fraction
label coupledFaceToBreakIndex = -1; label coupledFaceToBreakIndex = -1;
scalar coupledFaceToBreakEffTractionFraction = 0; scalar coupledFaceToBreakEffTractionFraction = 0;
forAll(coupledFacesToBreakEffTractionFraction, faceI) forAll(coupledFacesToBreakEffTractionFraction, faceI)
{ {
if if
( (
coupledFacesToBreakEffTractionFraction[faceI] coupledFacesToBreakEffTractionFraction[faceI]
> coupledFaceToBreakEffTractionFraction > coupledFaceToBreakEffTractionFraction
) )
{ {
coupledFaceToBreakEffTractionFraction = coupledFaceToBreakEffTractionFraction =
coupledFacesToBreakEffTractionFraction[faceI]; coupledFacesToBreakEffTractionFraction[faceI];
coupledFaceToBreakIndex = coupledFacesToBreak[faceI]; coupledFaceToBreakIndex = coupledFacesToBreak[faceI];
} }
} }
scalar gMaxCoupledEffTractionFraction = scalar gMaxCoupledEffTractionFraction =
returnReduce(coupledFaceToBreakEffTractionFraction, maxOp<scalar>()); returnReduce(coupledFaceToBreakEffTractionFraction, maxOp<scalar>());
if (Pstream::parRun()) if (Pstream::parRun())
@ -216,8 +216,8 @@ nCoupledFacesToBreak = 0;
{ {
if if
( (
mag(gMaxCoupledEffTractionFraction - coupledFaceToBreakEffTractionFraction) mag(gMaxCoupledEffTractionFraction - coupledFaceToBreakEffTractionFraction)
< SMALL < SMALL
) )
{ {
// Maximum traction fraction is on this processor // Maximum traction fraction is on this processor
@ -226,7 +226,7 @@ nCoupledFacesToBreak = 0;
} }
// Check if maximum is present on more then one processors // Check if maximum is present on more then one processors
label procID = Pstream::nProcs(); label procID = Pstream::nProcs();
if (procHasCoupledFaceToBreak) if (procHasCoupledFaceToBreak)
{ {
@ -235,11 +235,11 @@ nCoupledFacesToBreak = 0;
label minProcID = label minProcID =
returnReduce<label>(procID, minOp<label>()); returnReduce<label>(procID, minOp<label>());
if (procID != minProcID) if (procID != minProcID)
{ {
nCoupledFacesToBreak = 0; nCoupledFacesToBreak = 0;
} }
} }
if (gMaxCoupledEffTractionFraction > gMaxEffTractionFraction) if (gMaxCoupledEffTractionFraction > gMaxEffTractionFraction)
@ -258,7 +258,7 @@ nCoupledFacesToBreak = 0;
labelList index(Pstream::nProcs(), -1); labelList index(Pstream::nProcs(), -1);
if (nCoupledFacesToBreak) if (nCoupledFacesToBreak)
{ {
label patchID = label patchID =
mesh.boundaryMesh().whichPatch(coupledFaceToBreakIndex); mesh.boundaryMesh().whichPatch(coupledFaceToBreakIndex);
label start = mesh.boundaryMesh()[patchID].start(); label start = mesh.boundaryMesh()[patchID].start();
label localIndex = coupledFaceToBreakIndex - start; label localIndex = coupledFaceToBreakIndex - start;
@ -296,10 +296,10 @@ nCoupledFacesToBreak = 0;
mesh.boundaryMesh()[patchI] mesh.boundaryMesh()[patchI]
); );
label ngbProcNo = procPatch.neighbProcNo(); label ngbProcNo = procPatch.neighbProcNo();
if (ngbProcNo == procI) if (ngbProcNo == procI)
{ {
label start = label start =
mesh.boundaryMesh()[patchI].start(); mesh.boundaryMesh()[patchI].start();
coupledFaceToBreakIndex = start + index[procI]; coupledFaceToBreakIndex = start + index[procI];
nCoupledFacesToBreak = 1; nCoupledFacesToBreak = 1;
@ -356,14 +356,14 @@ nCoupledFacesToBreak = 0;
} }
else if (nCoupledFacesToBreak > 0) else if (nCoupledFacesToBreak > 0)
{ {
label patchID = label patchID =
mesh.boundaryMesh().whichPatch(coupledFaceToBreakIndex); mesh.boundaryMesh().whichPatch(coupledFaceToBreakIndex);
label start = mesh.boundaryMesh()[patchID].start(); label start = mesh.boundaryMesh()[patchID].start();
label localIndex = coupledFaceToBreakIndex - start; label localIndex = coupledFaceToBreakIndex - start;
faceToBreakTraction = traction.boundaryField()[patchID][localIndex]; faceToBreakTraction = traction.boundaryField()[patchID][localIndex];
faceToBreakNormal = n.boundaryField()[patchID][localIndex]; faceToBreakNormal = n.boundaryField()[patchID][localIndex];
// Scale broken face traction // Scale broken face traction
faceToBreakSigmaMax = sigmaMax.boundaryField()[patchID][localIndex]; faceToBreakSigmaMax = sigmaMax.boundaryField()[patchID][localIndex];
faceToBreakTauMax = tauMax.boundaryField()[patchID][localIndex]; faceToBreakTauMax = tauMax.boundaryField()[patchID][localIndex];
@ -436,19 +436,19 @@ nCoupledFacesToBreak = 0;
// All values on the new crack faces get set to zero // All values on the new crack faces get set to zero
// so we must manually correct them // so we must manually correct them
const vectorField DUpI = const vectorField DUpI =
DU.boundaryField()[cohesivePatchID].patchInternalField(); DU.boundaryField()[cohesivePatchID].patchInternalField();
const vectorField oldDUpI = const vectorField oldDUpI =
DU.oldTime().boundaryField()[cohesivePatchID].patchInternalField(); DU.oldTime().boundaryField()[cohesivePatchID].patchInternalField();
const vectorField UpI = const vectorField UpI =
U.boundaryField()[cohesivePatchID].patchInternalField(); U.boundaryField()[cohesivePatchID].patchInternalField();
const vectorField oldUpI = const vectorField oldUpI =
U.oldTime().boundaryField()[cohesivePatchID].patchInternalField(); U.oldTime().boundaryField()[cohesivePatchID].patchInternalField();
const symmTensorField sigmapI = const symmTensorField sigmapI =
sigma.boundaryField()[cohesivePatchID].patchInternalField(); sigma.boundaryField()[cohesivePatchID].patchInternalField();
const scalarField muPI = mu.boundaryField()[cohesivePatchID].patchInternalField(); const scalarField muPI = mu.boundaryField()[cohesivePatchID].patchInternalField();
const scalarField lambdaPI = lambda.boundaryField()[cohesivePatchID].patchInternalField(); const scalarField lambdaPI = lambda.boundaryField()[cohesivePatchID].patchInternalField();
// Global crack fields // Global crack fields
const vectorField globalDUpI = mesh.globalCrackField(DUpI); const vectorField globalDUpI = mesh.globalCrackField(DUpI);
const vectorField globalOldDUpI = mesh.globalCrackField(oldDUpI); const vectorField globalOldDUpI = mesh.globalCrackField(oldDUpI);
@ -478,31 +478,31 @@ nCoupledFacesToBreak = 0;
DU.boundaryField()[cohesivePatchID][i] = DU.boundaryField()[cohesivePatchID][i] =
0.5 0.5
*( *(
globalDUpI[globalIndex] globalDUpI[globalIndex]
+ globalDUpI[gcfa[globalIndex]] + globalDUpI[gcfa[globalIndex]]
); );
DU.oldTime().boundaryField()[cohesivePatchID][i] = DU.oldTime().boundaryField()[cohesivePatchID][i] =
0.5 0.5
*( *(
globalOldDUpI[globalIndex] globalOldDUpI[globalIndex]
+ globalOldDUpI[gcfa[globalIndex]] + globalOldDUpI[gcfa[globalIndex]]
); );
U.boundaryField()[cohesivePatchID][i] = U.boundaryField()[cohesivePatchID][i] =
0.5 0.5
*( *(
globalUpI[globalIndex] globalUpI[globalIndex]
+ globalUpI[gcfa[globalIndex]] + globalUpI[gcfa[globalIndex]]
); );
U.oldTime().boundaryField()[cohesivePatchID][i] = U.oldTime().boundaryField()[cohesivePatchID][i] =
0.5 0.5
*( *(
globalOldUpI[globalIndex] globalOldUpI[globalIndex]
+ globalOldUpI[gcfa[globalIndex]] + globalOldUpI[gcfa[globalIndex]]
); );
sigma.boundaryField()[cohesivePatchID][i] = sigma.boundaryField()[cohesivePatchID][i] =
0.5 0.5
*( *(
globalsigmapI[globalIndex] globalsigmapI[globalIndex]
+ globalsigmapI[gcfa[globalIndex]] + globalsigmapI[gcfa[globalIndex]]
); );
@ -535,7 +535,7 @@ nCoupledFacesToBreak = 0;
# include "calculateTraction.H" # include "calculateTraction.H"
//if (nFacesToBreak || nCoupledFacesToBreak) mesh.write(); traction.write(); //if (nFacesToBreak || nCoupledFacesToBreak) mesh.write(); traction.write();
// Initialise initiation traction for new cohesive patch face // Initialise initiation traction for new cohesive patch face
// we also need to update the traction_ field in the crack boundary condition // we also need to update the traction_ field in the crack boundary condition
// this is because it cannot set itself during mapping. // this is because it cannot set itself during mapping.
//for (label i=0; i<cohesivePatchDU.size(); i++) //for (label i=0; i<cohesivePatchDU.size(); i++)
@ -550,7 +550,7 @@ nCoupledFacesToBreak = 0;
|| (oldFaceIndex == coupledFaceToBreakIndex) || (oldFaceIndex == coupledFaceToBreakIndex)
) )
{ {
vector n0 = vector n0 =
mesh.Sf().boundaryField()[cohesivePatchID][i] mesh.Sf().boundaryField()[cohesivePatchID][i]
/mesh.magSf().boundaryField()[cohesivePatchID][i]; /mesh.magSf().boundaryField()[cohesivePatchID][i];
//vector n1 = -n0; //vector n1 = -n0;
@ -597,7 +597,7 @@ nCoupledFacesToBreak = 0;
} }
} }
} }
// hmmnn we only need a reference for very small groups of cells // hmmnn we only need a reference for very small groups of cells
// turn off for now // turn off for now
//# include "updateReference.H" //# include "updateReference.H"

View file

@ -165,7 +165,7 @@ if (runTime.outputTime() || topoChange)
GII.boundaryField()[patchi] = DUpatch.GII(); GII.boundaryField()[patchi] = DUpatch.GII();
damageAndCracks.boundaryField()[patchi] = DUpatch.crackingAndDamage(); damageAndCracks.boundaryField()[patchi] = DUpatch.crackingAndDamage();
} }
} }
//Info << "done" << endl; //Info << "done" << endl;

View file

@ -6,21 +6,21 @@ if(historyPatchID != -1)
//- calculate force in specified direction on topClamp patch //- calculate force in specified direction on topClamp patch
vector direction(0, 1, 0); vector direction(0, 1, 0);
//- for small strain or moving mesh //- for small strain or moving mesh
scalar force = gSum( scalar force = gSum(
direction & direction &
(mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]) (mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID])
); );
//- for large strain total lagrangian //- for large strain total lagrangian
// tensorField F = I + gradU.boundaryField()[historyPatchID]; // tensorField F = I + gradU.boundaryField()[historyPatchID];
// vectorField totalForce = mesh.Sf().boundaryField()[historyPatchID] & (sigma.boundaryField()[historyPatchID] & F); // vectorField totalForce = mesh.Sf().boundaryField()[historyPatchID] & (sigma.boundaryField()[historyPatchID] & F);
//vector force = sum( totalForce ); //vector force = sum( totalForce );
//scalar force = force[vector::Y]; //scalar force = force[vector::Y];
//- patchIntegrate utility integrates it this way but this is worng because the sigma tensor should //- patchIntegrate utility integrates it this way but this is worng because the sigma tensor should
//- be dotted with the surface normal to give the actual traction/force //- be dotted with the surface normal to give the actual traction/force
//- you cannot just take the component of the sigma tensor //- you cannot just take the component of the sigma tensor
@ -28,9 +28,9 @@ if(historyPatchID != -1)
// mesh.magSf().boundaryField()[historyPatchID] // mesh.magSf().boundaryField()[historyPatchID]
// *sigma.boundaryField()[historyPatchID].component(symmTensor::XY) // *sigma.boundaryField()[historyPatchID].component(symmTensor::XY)
// ); // );
scalar disp = max(U.boundaryField()[historyPatchID].component(vector::Y)); scalar disp = max(U.boundaryField()[historyPatchID].component(vector::Y));
//- write to file //- write to file
if(Pstream::master()) if(Pstream::master())
{ {

View file

@ -7,7 +7,7 @@ if(divDSigmaExpMethod == "standard")
); );
} }
else if(divDSigmaExpMethod == "surface") else if(divDSigmaExpMethod == "surface")
{ {
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
muf*(mesh.Sf() & fvc::interpolate(gradDU.T())) muf*(mesh.Sf() & fvc::interpolate(gradDU.T()))
@ -19,7 +19,7 @@ else if(divDSigmaExpMethod == "decompose")
{ {
surfaceTensorField shearGradDU = surfaceTensorField shearGradDU =
((I - n*n) & fvc::interpolate(gradDU)); ((I - n*n) & fvc::interpolate(gradDU));
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
mesh.magSf()* mesh.magSf()*

View file

@ -6,7 +6,7 @@ Info << nl;
forAll(netForces, patchI) forAll(netForces, patchI)
{ {
netForces[patchI] = gSum(mesh.Sf().boundaryField()[patchI] & sigma.boundaryField()[patchI]); netForces[patchI] = gSum(mesh.Sf().boundaryField()[patchI] & sigma.boundaryField()[patchI]);
Info << "patch\t" << mesh.boundary()[patchI].name() << "\t\tnet force is\t" Info << "patch\t" << mesh.boundary()[patchI].name() << "\t\tnet force is\t"
<< netForces[patchI] << " N" << endl; << netForces[patchI] << " N" << endl;
} }

View file

@ -28,10 +28,10 @@ if (runTime.outputTime())
), ),
sqrt((3.0/2.0)*magSqr(dev(sigma))) sqrt((3.0/2.0)*magSqr(dev(sigma)))
); );
Info<< "Max sigmaEq = " << max(sigmaEq).value() Info<< "Max sigmaEq = " << max(sigmaEq).value()
<< endl; << endl;
//- Calculate Cauchy stress //- Calculate Cauchy stress
volTensorField F = I + gradU; volTensorField F = I + gradU;
volScalarField J = det(F); volScalarField J = det(F);
@ -65,7 +65,7 @@ if (runTime.outputTime())
), ),
sqrt((3.0/2.0)*magSqr(dev(sigmaCauchy))) sqrt((3.0/2.0)*magSqr(dev(sigmaCauchy)))
); );
Info<< "Max sigmaCauchyEq = " << max(sigmaCauchyEq).value() Info<< "Max sigmaCauchyEq = " << max(sigmaCauchyEq).value()
<< endl; << endl;

View file

@ -10,7 +10,7 @@
( (
U.boundaryField()[patchID] U.boundaryField()[patchID]
); );
tensorField Finv = inv(I + gradU); tensorField Finv = inv(I + gradU);
vectorField newN = Finv & n.boundaryField()[patchID]; vectorField newN = Finv & n.boundaryField()[patchID];
newN /= mag(newN); newN /= mag(newN);

View file

@ -6,16 +6,16 @@ if(min(J.internalField()) > 0)
Info << "Moving mesh using least squares interpolation" << endl; Info << "Moving mesh using least squares interpolation" << endl;
leastSquaresVolPointInterpolation pointInterpolation(mesh); leastSquaresVolPointInterpolation pointInterpolation(mesh);
// Create point mesh // Create point mesh
pointMesh pMesh(mesh); pointMesh pMesh(mesh);
wordList types wordList types
( (
pMesh.boundary().size(), pMesh.boundary().size(),
calculatedFvPatchVectorField::typeName calculatedFvPatchVectorField::typeName
); );
pointVectorField pointU pointVectorField pointU
( (
IOobject IOobject
@ -28,7 +28,7 @@ if(min(J.internalField()) > 0)
dimensionedVector("zero", dimLength, vector::zero), dimensionedVector("zero", dimLength, vector::zero),
types types
); );
pointInterpolation.interpolate(U, pointU); pointInterpolation.interpolate(U, pointU);
const vectorField& pointUI = const vectorField& pointUI =

View file

@ -28,10 +28,10 @@ if (runTime.outputTime())
), ),
sqrt((3.0/2.0)*magSqr(dev(sigma))) sqrt((3.0/2.0)*magSqr(dev(sigma)))
); );
Info<< "Max sigmaEq = " << max(sigmaEq).value() Info<< "Max sigmaEq = " << max(sigmaEq).value()
<< endl; << endl;
//- Calculate Cauchy stress //- Calculate Cauchy stress
volTensorField F = I + gradU; volTensorField F = I + gradU;
volScalarField J = det(F); volScalarField J = det(F);
@ -65,7 +65,7 @@ if (runTime.outputTime())
), ),
sqrt((3.0/2.0)*magSqr(dev(sigmaCauchy))) sqrt((3.0/2.0)*magSqr(dev(sigmaCauchy)))
); );
Info<< "Max sigmaCauchyEq = " << max(sigmaCauchyEq).value() Info<< "Max sigmaCauchyEq = " << max(sigmaCauchyEq).value()
<< endl; << endl;
@ -105,7 +105,7 @@ if (runTime.outputTime())
// traction.boundaryField()[patchi] = // traction.boundaryField()[patchi] =
// nCurrent & sigmaCauchy.boundaryField()[patchi]; // nCurrent & sigmaCauchy.boundaryField()[patchi];
// } // }
// //- write boundary forces // //- write boundary forces
// //- integrate (sigma2PK & F) over reference area // //- integrate (sigma2PK & F) over reference area
// //- which is equivalent to integrating sigmaCauchy // //- which is equivalent to integrating sigmaCauchy
@ -117,12 +117,12 @@ if (runTime.outputTime())
// const tensorField& Fb = F.boundaryField()[patchi]; // const tensorField& Fb = F.boundaryField()[patchi];
// vectorField totalForce = mesh.Sf().boundaryField()[patchi] & (sigma.boundaryField()[patchi] & Fb); // vectorField totalForce = mesh.Sf().boundaryField()[patchi] & (sigma.boundaryField()[patchi] & Fb);
// //vectorField totalForce2 = Sf.boundaryField()[patchi] & (sigmaCauchy.boundaryField()[patchi]); // //vectorField totalForce2 = Sf.boundaryField()[patchi] & (sigmaCauchy.boundaryField()[patchi]);
// vector force = sum( totalForce ); // vector force = sum( totalForce );
// //vector force2 = sum( totalForce2 ); // //vector force2 = sum( totalForce2 );
// Info << "\ttotal force is " << force << " N" << endl; // Info << "\ttotal force is " << force << " N" << endl;
// //Info << "\ttotal force2 is " << force2 << " N" << endl; // //Info << "\ttotal force2 is " << force2 << " N" << endl;
// const tensorField& Fbinv = Finv.boundaryField()[patchi]; // const tensorField& Fbinv = Finv.boundaryField()[patchi];
// vectorField nCurrent = Fbinv & n.boundaryField()[patchi]; // vectorField nCurrent = Fbinv & n.boundaryField()[patchi];
// nCurrent /= mag(nCurrent); // nCurrent /= mag(nCurrent);

View file

@ -2,7 +2,7 @@ forAll(globalFaceZones, zoneI)
{ {
const label curZoneID = globalFaceZones[zoneI]; const label curZoneID = globalFaceZones[zoneI];
const labelList& curMap = const labelList& curMap =
globalToLocalFaceZonePointMap[zoneI]; globalToLocalFaceZonePointMap[zoneI];
const labelList& curZoneMeshPoints = const labelList& curZoneMeshPoints =
@ -10,7 +10,7 @@ forAll(globalFaceZones, zoneI)
vectorField curGlobalZonePointDispl vectorField curGlobalZonePointDispl
( (
curZoneMeshPoints.size(), curZoneMeshPoints.size(),
vector::zero vector::zero
); );
@ -21,13 +21,13 @@ forAll(globalFaceZones, zoneI)
forAll(curGlobalZonePointDispl, globalPointI) forAll(curGlobalZonePointDispl, globalPointI)
{ {
label localPoint = curMap[globalPointI]; label localPoint = curMap[globalPointI];
if(curZoneMeshPoints[localPoint] < mesh.nPoints()) if(curZoneMeshPoints[localPoint] < mesh.nPoints())
{ {
label procPoint = curZoneMeshPoints[localPoint]; label procPoint = curZoneMeshPoints[localPoint];
curGlobalZonePointDispl[globalPointI] = pointDUI[procPoint]; curGlobalZonePointDispl[globalPointI] = pointDUI[procPoint];
pointNumProcs[globalPointI] = 1; pointNumProcs[globalPointI] = 1;
} }
} }
@ -41,13 +41,13 @@ forAll(globalFaceZones, zoneI)
curGlobalZonePointDispl /= pointNumProcs; curGlobalZonePointDispl /= pointNumProcs;
} }
//- The curZonePointsDisplGlobal now contains the correct face zone //- The curZonePointsDisplGlobal now contains the correct face zone
// displacement in a global master processor order, now convert them // displacement in a global master processor order, now convert them
// back into the local proc order // back into the local proc order
vectorField curZonePointDispl vectorField curZonePointDispl
( (
curZoneMeshPoints.size(), curZoneMeshPoints.size(),
vector::zero vector::zero
); );
@ -55,7 +55,7 @@ forAll(globalFaceZones, zoneI)
{ {
label localPoint = curMap[globalPointI]; label localPoint = curMap[globalPointI];
curZonePointDispl[localPoint] = curZonePointDispl[localPoint] =
curGlobalZonePointDispl[globalPointI]; curGlobalZonePointDispl[globalPointI];
} }

View file

@ -7,7 +7,7 @@ if(divDSigmaExpMethod == "standard")
); );
} }
else if(divDSigmaExpMethod == "surface") else if(divDSigmaExpMethod == "surface")
{ {
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
muf*(mesh.Sf() & fvc::interpolate(gradDU.T())) muf*(mesh.Sf() & fvc::interpolate(gradDU.T()))
@ -19,7 +19,7 @@ if(divDSigmaExpMethod == "standard")
{ {
surfaceTensorField shearGradDU = surfaceTensorField shearGradDU =
((I - n*n)&fvc::interpolate(gradDU)); ((I - n*n)&fvc::interpolate(gradDU));
divDSigmaExp = fvc::div divDSigmaExp = fvc::div
( (
mesh.magSf() mesh.magSf()

View file

@ -6,7 +6,7 @@ if(divDSigmaLargeStrainExpMethod == "standard")
divDSigmaLargeStrainExp = divDSigmaLargeStrainExp =
fvc::div fvc::div
( (
mu*(gradDU & gradDU.T()) mu*(gradDU & gradDU.T())
//+ 0.5*lambda*(gradDU && gradDU)*I //- equivalent to 0.5*lambda*(I*tr(gradDU & gradDU.T())) //+ 0.5*lambda*(gradDU && gradDU)*I //- equivalent to 0.5*lambda*(I*tr(gradDU & gradDU.T()))
+ 0.5*lambda*tr(gradDU & gradDU.T())*I + 0.5*lambda*tr(gradDU & gradDU.T())*I
+ ((sigma + DSigma) & gradDU), + ((sigma + DSigma) & gradDU),

View file

@ -24,9 +24,9 @@ FieldField<Field, vector> extraVecs(ptc.size());
forAll (ptc, pointI) forAll (ptc, pointI)
{ {
const label curPoint = ptc[pointI]; const label curPoint = ptc[pointI];
const labelList& curFaces = pfaces[curPoint]; const labelList& curFaces = pfaces[curPoint];
// extraVecs.hook(new vectorField(curFaces.size())); //- no hook function // extraVecs.hook(new vectorField(curFaces.size())); //- no hook function
extraVecs.set extraVecs.set
( (
@ -35,11 +35,11 @@ FieldField<Field, vector> extraVecs(ptc.size());
); );
vectorField& curExtraVectors = extraVecs[pointI]; vectorField& curExtraVectors = extraVecs[pointI];
label nFacesAroundPoint = 0; label nFacesAroundPoint = 0;
const vector& pointLoc = mesh.points()[curPoint]; const vector& pointLoc = mesh.points()[curPoint];
// Go through all the faces // Go through all the faces
forAll (curFaces, faceI) forAll (curFaces, faceI)
{ {
@ -49,7 +49,7 @@ FieldField<Field, vector> extraVecs(ptc.size());
// or coupled calculate the extrapolation vector // or coupled calculate the extrapolation vector
label patchID = label patchID =
mesh.boundaryMesh().whichPatch(curFaces[faceI]); mesh.boundaryMesh().whichPatch(curFaces[faceI]);
if if
( (
!isA<emptyFvPatch>(bm[patchID]) !isA<emptyFvPatch>(bm[patchID])
@ -61,12 +61,12 @@ FieldField<Field, vector> extraVecs(ptc.size());
pointLoc pointLoc
- centres.boundaryField()[patchID] - centres.boundaryField()[patchID]
[bm[patchID].patch().whichFace(curFaces[faceI])]; [bm[patchID].patch().whichFace(curFaces[faceI])];
nFacesAroundPoint++; nFacesAroundPoint++;
} }
} }
} }
curExtraVectors.setSize(nFacesAroundPoint); curExtraVectors.setSize(nFacesAroundPoint);
} }

View file

@ -13,7 +13,7 @@ FieldField<Field, scalar> w(ptc.size());
const volVectorField& centres = mesh.C(); const volVectorField& centres = mesh.C();
const fvBoundaryMesh& bm = mesh.boundary(); const fvBoundaryMesh& bm = mesh.boundary();
pointScalarField volPointSumWeights pointScalarField volPointSumWeights
( (
IOobject IOobject
@ -25,13 +25,13 @@ FieldField<Field, scalar> w(ptc.size());
pMesh, pMesh,
dimensionedScalar("zero", dimless, 0) dimensionedScalar("zero", dimless, 0)
); );
forAll (ptc, pointI) forAll (ptc, pointI)
{ {
const label curPoint = ptc[pointI]; const label curPoint = ptc[pointI];
const labelList& curFaces = pf[curPoint]; const labelList& curFaces = pf[curPoint];
//w.hook(new scalarField(curFaces.size())); //philipc no hook function //w.hook(new scalarField(curFaces.size())); //philipc no hook function
w.set w.set
( (
@ -40,11 +40,11 @@ FieldField<Field, scalar> w(ptc.size());
); );
scalarField& curWeights = w[pointI]; scalarField& curWeights = w[pointI];
label nFacesAroundPoint = 0; label nFacesAroundPoint = 0;
const vector& pointLoc = mesh.points()[curPoint]; const vector& pointLoc = mesh.points()[curPoint];
// Go through all the faces // Go through all the faces
forAll (curFaces, faceI) forAll (curFaces, faceI)
{ {
@ -54,7 +54,7 @@ FieldField<Field, scalar> w(ptc.size());
// or coupled calculate the extrapolation vector // or coupled calculate the extrapolation vector
label patchID = label patchID =
mesh.boundaryMesh().whichPatch(curFaces[faceI]); mesh.boundaryMesh().whichPatch(curFaces[faceI]);
if if
( (
!isA<emptyFvPatch>(bm[patchID]) !isA<emptyFvPatch>(bm[patchID])
@ -74,23 +74,23 @@ FieldField<Field, scalar> w(ptc.size());
bm[patchID].patch().whichFace(curFaces[faceI]) bm[patchID].patch().whichFace(curFaces[faceI])
] ]
); );
nFacesAroundPoint++; nFacesAroundPoint++;
} }
} }
} }
// Reset the sizes of the local weights // Reset the sizes of the local weights
curWeights.setSize(nFacesAroundPoint); curWeights.setSize(nFacesAroundPoint);
// Collect the sum of weights for parallel correction // Collect the sum of weights for parallel correction
volPointSumWeights[curPoint] += sum(curWeights); volPointSumWeights[curPoint] += sum(curWeights);
} }
// Do parallel correction of weights // Do parallel correction of weights
// Update coupled boundaries // Update coupled boundaries
// Work-around for cyclic parallels. // Work-around for cyclic parallels.
/*if (Pstream::parRun() && !mesh.parallelData().cyclicParallel()) /*if (Pstream::parRun() && !mesh.parallelData().cyclicParallel())
{ {
forAll (volPointSumWeights.boundaryField(), patchI) forAll (volPointSumWeights.boundaryField(), patchI)
@ -100,7 +100,7 @@ FieldField<Field, scalar> w(ptc.size());
volPointSumWeights.boundaryField()[patchI].initAddField(); volPointSumWeights.boundaryField()[patchI].initAddField();
} }
} }
forAll (volPointSumWeights.boundaryField(), patchI) forAll (volPointSumWeights.boundaryField(), patchI)
{ {
if (volPointSumWeights.boundaryField()[patchI].coupled()) if (volPointSumWeights.boundaryField()[patchI].coupled())
@ -112,7 +112,7 @@ FieldField<Field, scalar> w(ptc.size());
} }
} }
}*/ }*/
// Re-scale the weights for the current point // Re-scale the weights for the current point
forAll (ptc, pointI) forAll (ptc, pointI)
{ {

View file

@ -6,7 +6,7 @@ if(solidInterfaceCorr)
{ {
solidInterfacePtr = &rheology.solInterface(); solidInterfacePtr = &rheology.solInterface();
solidInterfacePtr->modifyProperties(muf, lambdaf); solidInterfacePtr->modifyProperties(muf, lambdaf);
//- solidInterface needs muf and lambdaf to be used for divDSigmaExp //- solidInterface needs muf and lambdaf to be used for divDSigmaExp
if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose") if(divDSigmaExpMethod != "surface" && divDSigmaExpMethod != "decompose")
{ {

View file

@ -21,7 +21,7 @@ forAll (bm, patchI)
) )
{ {
const labelList& bp = bm[patchI].patch().boundaryPoints(); const labelList& bp = bm[patchI].patch().boundaryPoints();
const labelList& meshPoints = bm[patchI].patch().meshPoints(); const labelList& meshPoints = bm[patchI].patch().meshPoints();
forAll (bp, pointI) forAll (bp, pointI)

Some files were not shown because too many files have changed in this diff Show more