solidDisplacementThermo: Updated adding q and divq functions

This commit is contained in:
Henry Weller
2020-09-25 16:29:15 +01:00
parent f15d150ca8
commit 1bd316e69a
4 changed files with 27 additions and 4 deletions

View File

@ -6,7 +6,6 @@ const volScalarField& E(thermo.E());
const volScalarField& nu(thermo.nu());
const volScalarField Cp(thermo.Cp());
const volScalarField kappa(thermo.kappa());
Info<< "Calculating Lame's coefficients\n" << endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -73,8 +73,9 @@ int main(int argc, char *argv[])
fvScalarMatrix TEqn
(
fvm::ddt(rho, Cp, T)
== fvm::laplacian(kappa, T)
+ fvOptions(rho*Cp, T)
+ thermo.divq(T)
==
fvOptions(rho*Cp, T)
);
fvOptions.constrain(TEqn);

View File

@ -25,6 +25,9 @@ License
#include "solidDisplacementThermo.H"
#include "fvMesh.H"
#include "fvmLaplacian.H"
#include "fvcSnGrad.H"
#include "surfaceInterpolate.H"
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
@ -564,4 +567,18 @@ bool Foam::solidDisplacementThermo::read()
}
Foam::tmp<Foam::surfaceScalarField>
Foam::solidDisplacementThermo::q() const
{
return -fvc::interpolate(kappa_)*fvc::snGrad(T());
}
Foam::tmp<Foam::fvScalarMatrix>
Foam::solidDisplacementThermo::divq(volScalarField& T) const
{
return -fvm::laplacian(kappa_, T);
}
// ************************************************************************* //

View File

@ -368,6 +368,12 @@ public:
const label patchi
) const;
//- Return the heat flux
virtual tmp<surfaceScalarField> q() const;
//- Return the source term for the energy equation
virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
//- Update properties
virtual void correct();