# setting a reference value using conjugateHeatFoam (or coupledFvScalarMatrix)

 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 23, 2010, 11:46 setting a reference value using conjugateHeatFoam (or coupledFvScalarMatrix) #1 Senior Member   Ben K Join Date: Feb 2010 Location: Ottawa, Canada Posts: 140 Rep Power: 11 Hi, I'm using a modified conjugateHeatFoam solver to solve my multi-region 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.set ( 0, new fvScalarMatrix ( eqn0... ) ); equations.set ( 1, new fvScalarMatrix ( eqn1... ) ); equations.set ( 2, new fvScalarMatrix ( eqn2... ) ); etc...``` I've tried something like: 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?

 August 24, 2010, 14:59 #2 Senior Member   Hrvoje Jasak Join Date: Mar 2009 Location: London, England Posts: 1,781 Rep Power: 22 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 __________________ Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk

 August 24, 2010, 16:46 #3 Senior Member   Ben K Join Date: Feb 2010 Location: Ottawa, Canada Posts: 140 Rep Power: 11 Thanks for your help. I went with your first suggestion and this seemed to work: Code: ```fvScalarMatrix Eqn0( fvm::laplacian(D1,c1) ); Eqn0.setReference(location, value); coupledFvScalarMatrix Equations(3); Equations.set( 0, new fvScalarMatrix(Eqn0) ); Equations.set(1,new fvScalarMatrix(fvm::laplacian(D2,c2))); Equations.set(2,new fvScalarMatrix(fvm::laplacian(D3, c3)));```

 August 25, 2010, 04:27 #4 Senior Member   Hrvoje Jasak Join Date: Mar 2009 Location: London, England Posts: 1,781 Rep Power: 22 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 mm.abdollahzadeh likes this. __________________ Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk

 September 9, 2010, 19:09 #5 New Member   Anh Le Join Date: Jul 2010 Posts: 5 Rep Power: 8 I figured out my problem. Thanks Last edited by hut; September 10, 2010 at 11:00.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post skabilan OpenFOAM Installation 3 July 28, 2009 00:35 allenzhao OpenFOAM Installation 127 January 30, 2009 20:08 Bruno Main CFD Forum 1 January 30, 2007 01:34 anne OpenFOAM Installation 8 June 15, 2006 09:27 brooksmoses OpenFOAM Installation 48 April 16, 2006 00:20

All times are GMT -4. The time now is 20:50.