CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   adding thermophysical model to conjugateHeatFoam (http://www.cfd-online.com/Forums/openfoam-programming-development/94981-adding-thermophysical-model-conjugateheatfoam.html)

helmut December 1, 2011 13:12

adding thermophysical model to conjugateHeatFoam
 
Hello,
I want to add a thermophysical model to the fluid side of conjugateHeatFoam. Itís not going well!
To get started, I used rhoPisoFoam as a model to rewrite solveFluid.H, but solving for T+T, not h. After it all compiled, I got the runtime error message:

--> FOAM FATAL ERROR:
given field does not correspond to patch. Patch size: 10 field size: 0

From function PatchToPatchInterpolation::faceInterpolate(const Field<Type> ff)
in file /usr/local/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/PatchToPatchInterpolate.C at line 133.

FOAM aborting

gdb showed that the error was spawned by the coupled solver solving for T+T.

I backed up and took out all references to the turbulence and thermo models. Fields defined by the thermo model became defined in the 0/ directory (or got left out altogether). The code then ran.

Reinstating the code to create the thermo and turbulence models (without using them later in the solver) brought back the error. Both T eqns referenced rho and Cp in the ddt terms. Coupling those didnít help. I made the application steady, basing solveFluid.H on rhoSimpleFoam. Then only k and T were common to both temperature equations:

coupledFvScalarMatrix TEqns(2);

// Add fluid equation
TEqns.set
(
0,
new fvScalarMatrix
(
fvm::div((fvc::interpolate(Cp)*phi), T)
- fvm::laplacian(k, T)
)
);

// Add solid equation
TEqns.set
(
1,
new fvScalarMatrix
(
-fvm::laplacian(kSolid, Tsolid)
)
);

TEqns.solve();

The problem remains: If I donít create the thermo and turbulence models, the code runs, but when I create them I get the problem in the coupled T+T solution.

Any help will be greatly appreciated! Thanks.

helmut December 8, 2011 11:22

The above problem was solved by creating the thermo model after creating all of the fields. Simple, really.


All times are GMT -4. The time now is 22:41.