|
[Sponsors] |
How to scale a volScalarField by cell volume? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 9, 2012, 10:13 |
How to scale a volScalarField by cell volume?
|
#1 |
New Member
Tyler V
Join Date: Jul 2012
Posts: 24
Rep Power: 14 |
Hello,
I am trying to scale a volScalarField (myField) by cell volume. Based on other threads on this topic, I have the following code (which works) Code:
volScalarField cellVolume ( IOobject ( "cellVolume", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("zero", dimensionSet(0, 3, 0, 0, 0, 0, 0), 0.0) ); cellVolume.internalField() = mesh.V(); myField = myField * cellVolume; Any suggestions? |
|
July 9, 2012, 10:58 |
|
#2 |
Senior Member
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 16 |
Use this:
Code:
T.internalField() *= mesh.V(); |
|
July 9, 2012, 11:25 |
Thanks!
|
#3 |
New Member
Tyler V
Join Date: Jul 2012
Posts: 24
Rep Power: 14 |
Steven,
Thanks, that's what I was looking for! Both of the following work as expected. Code:
myField = mag(fvc::laplacian(T)); myField.internalField() *= mesh.V(); Code:
myField.internalField() = mag(fvc::laplacian(T)) * mesh.V(); |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 18:22 |
draw any scalar vs. cell volume | wersoe | OpenFOAM Post-Processing | 0 | April 3, 2012 04:52 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 10:56 |
Cell centroid and cell volume in general, and in Fluent | zmester | Main CFD Forum | 3 | October 17, 2009 12:05 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |