setting a reference value using conjugateHeatFoam (or coupledFvScalarMatrix)
Hi, I'm using a modified conjugateHeatFoam solver to solve my multiregion problem. One of my equations has zeroGradient boundary conditions on each end (it's a 1D problem) and so I need to set a reference value for the equation. Usually I'd just use:
equationName.setReference(position, value); But when it comes to the coupledFvScalarMatrix used in conjugateHeatFoam, what is the eqationName? For example, coupledFvScalarMatrix is set up like this: Code:
coupledFvScalarMatrix equations(9); equations[0].setReference(position, value); but this doesn't compile and gives the error "class Foam::lduMatrix has no member named setReference" Can anybody help me out with this? 
Yes, setReference will be in the fvMatrix. First, make the fvMatrix, then set the reference and finally insert it in. If this is inconvenient, you can refCast the equations[0] into fvMatrix and it will then let you set the reference.
The problem (well, advantage) is that coupledMatrix is a PtrList of lduMatrices, and fvMatrix is derived from lduMatrix. Enjoy, Hrv 
Thanks for your help.
I went with your first suggestion and this seemed to work: Code:
fvScalarMatrix Eqn0( fvm::laplacian(D1,c1) ); 
Better. If you play with pointers a bit, you can avoid copies.
fvScalarMatrix* Eqn0Ptr = new fvScalarMatrix( fvm::laplacian(D1,c1) ); Eqn0Ptr>setReference(location, value); coupledFvScalarMatrix Equations(3); Equations.set(0, Eqn0Ptr); ... Enjoy, Hrv 
I figured out my problem. Thanks

All times are GMT 4. The time now is 13:43. 