diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C index 48b28a07e491f777ee2c718757f28dd3e4d28107..5297be327f2d6fe69f8725f0987f51a1b4c0f4aa 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C @@ -40,13 +40,14 @@ Description #include "rhoThermo.H" #include "turbulenceModel.H" #include "fixedGradientFvPatchFields.H" +#include "zeroGradientFvPatchFields.H" #include "regionProperties.H" #include "compressibleCourantNo.H" #include "solidRegionDiffNo.H" #include "solidThermo.H" #include "radiationModel.H" #include "fvIOoptionList.H" - +#include "coordinateSystem.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C index d076652a1dd2b9759add875df934b731a11b3145..a3615c4309ad487272c631ce96d2c81a9834e0f8 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C @@ -37,6 +37,7 @@ Description #include "solidThermo.H" #include "radiationModel.H" #include "fvIOoptionList.H" +#include "coordinateSystem.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/solveSolid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/solveSolid.H index 7573002af52e47423c72abede50f870fa812cdcf..93f7146730fb5180b92f1396fa4bf12698d052e3 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/solveSolid.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/solveSolid.H @@ -3,7 +3,9 @@ { fvScalarMatrix hEqn ( - - fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)") + thermo.isotropic() + ? -fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)") + : -fvm::laplacian(betav*tAnialpha(), h, "laplacian(alpha,h)") + fvOptions(rho, h) ); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H index df3915980b546d54504a774b894929a170db062d..703ed6e4c2cde1456c96ebda5b01920793298c81 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H @@ -1,4 +1,5 @@ // Initialise solid field pointer lists + PtrList<coordinateSystem> coordinates(solidRegions.size()); PtrList<solidThermo> thermos(solidRegions.size()); PtrList<radiation::radiationModel> radiations(solidRegions.size()); PtrList<fv::IOoptionList> solidHeatSources(solidRegions.size()); @@ -23,6 +24,16 @@ new fv::IOoptionList(solidRegions[i]) ); + if (!thermos[i].isotropic()) + { + Info<< " Adding coordinateSystems\n" << endl; + coordinates.set + ( + i, + coordinateSystem::New(solidRegions[i], thermos[i]) + ); + } + IOobject betavSolidIO ( "betavSolid", diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H index ad8894a631552af47a127e7fbcaabc62b36f588a..a36fa7e98fcb163da272d8defcd3206033b79e9a 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H @@ -8,10 +8,36 @@ tmp<volScalarField> tcp = thermo.Cp(); const volScalarField& cp = tcp(); - tmp<volScalarField> talpha = thermo.alpha(); - const volScalarField& alpha = talpha(); - tmp<volScalarField> tkappa = thermo.kappa(); - const volScalarField& kappa = tkappa(); + tmp<volSymmTensorField> tAnialpha; + + if (!thermo.isotropic()) + { + tmp<volVectorField> tkappaCp = thermo.Kappa()/cp; + + const coordinateSystem& coodSys = coordinates[i]; + tAnialpha = + tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "Anialpha", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + tkappaCp().dimensions(), + zeroGradientFvPatchVectorField::typeName + ) + ); + + volSymmTensorField& Anialpha = tAnialpha(); + Anialpha.internalField() = coodSys.R().transformVector(tkappaCp()); + Anialpha.correctBoundaryConditions(); + } volScalarField& h = thermo.he(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C index 437ea78327462d81682bd59c630399111835002f..9ec57f2f92fad8c27b2bbec760753fc0788bdcfe 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,38 +56,4 @@ Foam::scalar Foam::solidRegionDiffNo return DiNum; } - -Foam::scalar Foam::solidRegionDiffNo -( - const fvMesh& mesh, - const Time& runTime, - const volScalarField& Cprho, - const volSymmTensorField& kappadirectional -) -{ - scalar DiNum = 0.0; - scalar meanDiNum = 0.0; - - volScalarField kappa(mag(kappadirectional)); - - //- Take care: can have fluid domains with 0 cells so do not test for - // zero internal faces. - surfaceScalarField kapparhoCpbyDelta - ( - mesh.surfaceInterpolation::deltaCoeffs() - * fvc::interpolate(kappa) - / fvc::interpolate(Cprho) - ); - - DiNum = gMax(kapparhoCpbyDelta.internalField())*runTime.deltaT().value(); - - meanDiNum = (average(kapparhoCpbyDelta)).value()*runTime.deltaT().value(); - - Info<< "Region: " << mesh.name() << " Diffusion Number mean: " << meanDiNum - << " max: " << DiNum << endl; - - return DiNum; -} - - // ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.H index cb4dd30b6a3801b7674abfe4a17c27e516a819e6..77eda7c843551345d460e98f5d371b3972df5217 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,15 +41,6 @@ namespace Foam const volScalarField& Cprho, const volScalarField& kappa ); - - scalar solidRegionDiffNo - ( - const fvMesh& mesh, - const Time& runTime, - const volScalarField& Cprho, - const volSymmTensorField& kappa - ); - } #endif diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H index 878780baf1df939beceb7efde5ff738d5da93d84..a7a65b17bd4c9863a23d0749d64e3cbcb5af5348 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H @@ -1,18 +1,29 @@ - scalar DiNum = -GREAT; +scalar DiNum = -GREAT; - forAll(solidRegions, i) +forAll(solidRegions, i) +{ + #include "setRegionSolidFields.H" + + tmp<volScalarField> magKappa; + if (thermo.isotropic()) + { + magKappa = thermo.kappa(); + } + else { - #include "setRegionSolidFields.H" + magKappa = mag(thermo.Kappa()); + } - DiNum = max + DiNum = max + ( + solidRegionDiffNo ( - solidRegionDiffNo - ( - solidRegions[i], - runTime, - rho*cp, - kappa - ), - DiNum - ); - } + solidRegions[i], + runTime, + rho*cp, + magKappa() + ), + DiNum + ); + +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H index 86f23292e37445c2cddc27fe4c651290e4cd9e1d..7bf7562d9b6736cff2e9c81cffdfe71a8b89f570 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H @@ -9,7 +9,11 @@ if (finalIter) tmp<fvScalarMatrix> hEqn ( fvm::ddt(betav*rho, h) - - fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)") + - ( + thermo.isotropic() + ? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)") + : fvm::laplacian(betav*tAnialpha(), h, "laplacian(alpha,h)") + ) == fvOptions(rho, h) ); diff --git a/src/thermophysicalModels/solidSpecie/transport/const/constAnIsoSolidTransport.H b/src/thermophysicalModels/solidSpecie/transport/const/constAnIsoSolidTransport.H index 60b846fd7ad03646e72b769e294bafa3ae402d3f..718f648143354953ad3b02ed04e8b19548e42b06 100644 --- a/src/thermophysicalModels/solidSpecie/transport/const/constAnIsoSolidTransport.H +++ b/src/thermophysicalModels/solidSpecie/transport/const/constAnIsoSolidTransport.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,6 +111,9 @@ public: return "constAnIso<" + Thermo::typeName() + '>'; } + //- Is the thermal conductivity isotropic + static const bool isotropic = false; + //- Isotropic thermal conductivity [W/mK] inline scalar kappa(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransport.H b/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransport.H index 5b49beab675742b8b004c4381e942c9a1a0f4cd2..fc9cb4438a5d999d22bd58777a512a27f533d75a 100644 --- a/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransport.H +++ b/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransport.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -112,6 +112,9 @@ public: return "constIso<" + Thermo::typeName() + '>'; } + //- Is the thermal conductivity isotropic + static const bool isotropic = true; + //- Isotropic thermal conductivity [W/mK] inline scalar kappa(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransport.H b/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransport.H index 00cc81e1b3be90735d58939f5009204c87e80d4f..3592626d8045b8846d58a092bde25a53ab74750d 100644 --- a/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransport.H +++ b/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransport.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -121,6 +121,9 @@ public: return "exponential<" + Thermo::typeName() + '>'; } + //- Is the thermal conductivity isotropic + static const bool isotropic = true; + //- Thermal conductivity [W/mK] inline scalar kappa(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H b/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H index 8d13ea6e28a61c7467f6b90b0922e40e5b587125..146656d69e97a30e7dbebf5a4eb1a86a9b64ff38 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H +++ b/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,6 +99,12 @@ public: //- Anisotropic thermal conductivity [W/m/K] virtual tmp<volVectorField> Kappa() const; + //- Return true if thermal conductivity is isotropic + virtual bool isotropic() const + { + return MixtureType::thermoType::isotropic; + } + // Per patch calculation diff --git a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H index e3cf9b8e19d641b554e549be24ac75700857dbe9..04934ca950cf559da6bdf6fdbb9fc35245fb7e23 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H +++ b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -144,6 +144,9 @@ public: //- Thermal conductivity [W/m/K] virtual tmp<volVectorField> Kappa() const = 0; + //- Return true if thermal conductivity is isotropic + virtual bool isotropic() const = 0; + // Per patch calculation