Tutorial fix elasticThermalSolidFoam

This commit is contained in:
Hrvoje Jasak 2014-04-10 20:54:24 +01:00
parent 45576c2dea
commit e732980a53
8 changed files with 181 additions and 190 deletions

View file

@ -12,7 +12,6 @@
mesh
);
// volTensorField gradU = fvc::grad(U);
volTensorField gradU
(
IOobject
@ -26,7 +25,7 @@
mesh,
dimensionedTensor("zero", dimless, tensor::zero)
);
//surfaceVectorField snGradU = fvc::snGrad(U);
surfaceVectorField snGradU
(
IOobject
@ -115,9 +114,14 @@
thermalModel thermal(T);
volScalarField C = thermal.C();
volScalarField k = thermal.k();
volScalarField k
(
"DT",
thermal.k()
);
volScalarField threeKalpha = rheology.threeK()*rho*thermal.alpha();
surfaceScalarField threeKalphaf = fvc::interpolate(threeKalpha, "threeKalpha");
surfaceScalarField threeKalphaf =
fvc::interpolate(threeKalpha, "threeKalpha");
volScalarField T0 = thermal.T0();
volScalarField rhoC = rho*C;
@ -136,10 +140,7 @@ volVectorField aitkenDelta
mesh,
dimensionedVector("zero", dimLength, vector::zero)
);
// aitken relaxation factor
scalar aitkenInitialRes = 1.0;
scalar aitkenTheta = 0.01;
// if(mesh.relax(U.name()))
// {
// aitkenTheta = mesh.relaxationFactor(U.name());
// }

View file

@ -99,8 +99,7 @@ int main(int argc, char *argv[])
while
(
relResT > convergenceToleranceT
&&
++iCorr < nCorr
&& ++iCorr < nCorr
);
Info<< "Solved for " << T.name()
@ -112,7 +111,7 @@ int main(int argc, char *argv[])
<< ", ClockTime = " << runTime.elapsedClockTime() << " s"
<< endl;
// solve momentum equation for displacement
// Solve momentum equation for displacement
iCorr = 0;
volVectorField gradThreeKalphaDeltaT =
fvc::grad(threeKalpha*(T-T0), "grad(threeKalphaDeltaT)");
@ -160,6 +159,7 @@ int main(int argc, char *argv[])
Info<< "\tCorrector " << iCorr
<< ", residual = " << solverPerfU.initialResidual()
<< ", relative res = " << relResU;
if (aitkenRelax)
{
Info << ", aitken = " << aitkenTheta;
@ -170,11 +170,10 @@ int main(int argc, char *argv[])
while
(
iCorr++ == 0
||
(//solverPerfU.initialResidual() > convergenceTolerance
|| (
relResU > convergenceToleranceU
&&
iCorr < nCorr)
&& iCorr < nCorr
)
);
Info<< "Solved for " << U.name()

View file

@ -35,24 +35,20 @@ boundaryField
type fixedValue;
value uniform 100;
}
outside
{
type fixedValue;
value uniform 100;
}
front
{
type empty;
//type symmetryPlane;
}
back
{
type empty;
//type symmetryPlane;
}
}
// ************************************************************************* //

View file

@ -29,32 +29,31 @@ boundaryField
{
type symmetryPlane;
}
inside
{
type solidTraction;
traction uniform ( 0 0 0 );
pressure uniform 50e6;
DT k;
value uniform (0 0 0);
}
outside
{
type solidTraction;
traction uniform ( 0 0 0 );
pressure uniform 0.1e6;
DT k;
value uniform (0 0 0);
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View file

@ -27,7 +27,6 @@ vertices
(0.5 0 0.1)
(0.7 0 0.1)
(0 0.7 0.1)
);
blocks
@ -45,26 +44,14 @@ edges
patches
(
empty back
(
(3 2 1 0)
)
empty front
(
(4 5 6 7)
)
symmetryPlane left
(
(4 7 3 0)
)
symmetryPlane bottom
(
(1 2 6 5)
)
patch inside
(
(0 1 5 4)
@ -73,6 +60,14 @@ patches
(
(7 6 2 3)
)
empty back
(
(3 2 1 0)
)
empty front
(
(4 5 6 7)
)
);
mergePatchPairs

View file

@ -17,41 +17,41 @@ FoamFile
6
(
back
{
type empty;
nFaces 600;
startFace 1130;
}
front
{
type empty;
nFaces 600;
startFace 1730;
}
left
{
type symmetryPlane;
nFaces 10;
startFace 2330;
startFace 1130;
}
bottom
{
type symmetryPlane;
nFaces 10;
startFace 2340;
startFace 1140;
}
inside
{
type patch;
nFaces 60;
startFace 2350;
startFace 1150;
}
outside
{
type patch;
nFaces 60;
startFace 2410;
startFace 1210;
}
back
{
type empty;
nFaces 600;
startFace 1270;
}
front
{
type empty;
nFaces 600;
startFace 1870;
}
)

View file

@ -23,4 +23,5 @@ thermal
T0 T0 [0 0 0 1 0 0 0] 0;
}
// ************************************************************************* //