This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/solidMechanics/elasticThermalSolidFoam/createFields.H

147 lines
3.2 KiB
C++
Raw Normal View History

2012-09-11 15:42:55 +00:00
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volTensorField gradU
(
IOobject
(
2014-04-10 19:54:24 +00:00
"grad(U)",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedTensor("zero", dimless, tensor::zero)
2014-04-10 19:54:24 +00:00
);
surfaceVectorField snGradU
(
IOobject
(
"snGrad(U)",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
2014-04-10 19:54:24 +00:00
dimensionedVector("zero", dimless, vector::zero)
);
2012-09-11 15:42:55 +00:00
volSymmTensorField epsilon
(
IOobject
(
"epsilon",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedSymmTensor("zero", dimless, symmTensor::zero)
);
Info<< "Reading field T\n" << endl;
volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volSymmTensorField sigma
(
IOobject
(
"sigma",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero)
);
volVectorField divSigmaExp
2012-09-11 15:42:55 +00:00
(
IOobject
(
"divSigmaExp",
2012-09-11 15:42:55 +00:00
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero)
);
surfaceVectorField n = mesh.Sf()/mesh.magSf();
// mechanical properties
constitutiveModel rheology(sigma, U);
2012-09-11 15:42:55 +00:00
volScalarField rho = rheology.rho();
volScalarField mu = rheology.mu();
volScalarField lambda = rheology.lambda();
surfaceScalarField muf = fvc::interpolate(mu, "mu");
surfaceScalarField lambdaf = fvc::interpolate(lambda, "lambda");
// thermal properties
Info<< "Reading thermal model\n" << endl;
thermalModel thermal(T);
2012-09-11 15:42:55 +00:00
volScalarField C = thermal.C();
2014-04-10 19:54:24 +00:00
volScalarField k
(
"DT",
thermal.k()
);
volScalarField threeKalpha = rheology.threeK()*rho*thermal.alpha();
2014-04-10 19:54:24 +00:00
surfaceScalarField threeKalphaf =
fvc::interpolate(threeKalpha, "threeKalpha");
volScalarField T0 = thermal.T0();
volScalarField rhoC = rho*C;
2012-09-11 15:42:55 +00:00
2014-04-10 19:54:24 +00:00
// for aitken relaxation
volVectorField aitkenDelta
(
IOobject
(
2014-04-10 19:54:24 +00:00
"aitkenDelta",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedVector("zero", dimLength, vector::zero)
);
2014-04-10 19:54:24 +00:00
// aitken relaxation factor
scalar aitkenInitialRes = 1.0;
scalar aitkenTheta = 0.01;