|
[Sponsors] |
August 3, 2010, 09:42 |
looping over cells
|
#1 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
Hi all,
I am using the chtMultiRegionSimpleFoam solver. I want to define different properties (cp, K, rho) for different zones of my solid. Therefor I edited the "solveSolid.H"-file in this way: Quote:
But when I start the simulation, it lasts very long to solve my solid region. I think the loops are responsible for that. An additinal problem is that, that the values for cp, K and rho are not calculated different in the different zones. Is there a mistake in my loops construction? Is there a better alternative to calculate the properties different in different zones of the solid instead of my loops over all cells, which lasts so long? Thanks in advance! Best regards Chrisi |
||
August 4, 2010, 06:55 |
|
#2 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
Quote:
There are a number of problems. From what you write, you are trying to adjust the entire fields (rho, cp, K) within each loop and using entire fields for everything (including T) instead of doing it element-wise. This would certainly slow things down a lot, and probably is not what you want. If you didn't make any other changes, you also have cp defined as const volScalarField& , so I don't see how any of it actually compiled at all. |
||
August 4, 2010, 09:12 |
|
#3 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
Thank you for your hint!
I now did it this way Quote:
Best regards Chrisi |
||
August 4, 2010, 09:26 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
Quote:
Code:
forAll(solidRegions[i].cellZones(), zoneI) { const cellZone& cz = solidRegions[i].cellZones()[zoneI]; const labelList& cells = cz; if (cz.name() == "s-oc") { forAll(cells, iCells) { const label cellId = cells[iCells]; const scalar& cellT = T[cellId]; cp[cellId] = 380.68 + cellT * (0.35536 - 0.00012713 * cellT); K[cellId] = 9.6995954 + cellT * (0.017429246 - 2.0551036e-06 * cellT); rho[cellId] = 7920; } } } |
||
August 5, 2010, 03:44 |
|
#5 |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
Thank you again.
I changed it. Regards Chrisi |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Netgen] Import netgen mesh to OpenFOAM | hsieh | OpenFOAM Meshing & Mesh Conversion | 32 | September 13, 2011 06:50 |
[snappyHexMesh] external flow with snappyHexMesh | chelvistero | OpenFOAM Meshing & Mesh Conversion | 11 | January 15, 2010 20:43 |
physical boundary error!! | kris | Siemens | 2 | August 3, 2005 01:32 |
problem while looping over cells in LES | Jimmy | FLUENT | 0 | September 5, 2002 16:33 |
Looping over cells | Karl | FLUENT | 4 | March 26, 2002 22:18 |