|
[Sponsors] | |||||
setting a reference value using conjugateHeatFoam (or coupledFvScalarMatrix) |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 20 ![]() |
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...
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? |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,908
Rep Power: 34 ![]() |
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 |
|
|
|
|
|
|
|
|
#3 |
|
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 20 ![]() |
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))); |
|
|
|
|
|
|
|
|
#4 |
|
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,908
Rep Power: 34 ![]() |
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
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
|
|
|
|
|
|
|
#5 |
|
New Member
Anh Le
Join Date: Jul 2010
Posts: 5
Rep Power: 17 ![]() |
I figured out my problem. Thanks
Last edited by hut; September 10, 2010 at 12:00. |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error with Wmake | skabilan | OpenFOAM Installation | 3 | July 28, 2009 01:35 |
| OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |
| G95 + CGNS | Bruno | Main CFD Forum | 1 | January 30, 2007 01:34 |
| Building OpenFoAm on SGI Altix 64bits | anne | OpenFOAM Installation | 8 | June 15, 2006 10:27 |
| Windows Installation BugsComments on Petrbs patch | brooksmoses | OpenFOAM Installation | 48 | April 16, 2006 01:20 |