|
[Sponsors] |
March 24, 2011, 12:04 |
Syntax question relating volScalarField
|
#1 |
Member
Sabin Ceuca
Join Date: Mar 2010
Location: Munich
Posts: 42
Rep Power: 16 |
Hi Foamers,
I have the following question is it possible to "force" a volScalarField in this way? volScalarField somethingSomething ( IOobject ( "somethingSomething", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("zero",dimensionSet(1,0-1,0,0,0,0),A*B) ); with the product of A*B having a different dimension, i.e. to overwrite the dimension? |
|
March 24, 2011, 13:46 |
|
#2 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 |
So basically this
Code:
volScalarField somethingSomething ( IOobject ( "somethingSomething", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, A*B, ...boundary conditions... ); if they form a volScalarField, you just remove mesh, like this Code:
volScalarField somethingSomething ( IOobject ( "somethingSomething", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), A*B ); |
|
March 24, 2011, 14:24 |
|
#3 |
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23 |
I found the best thing to do is define another dimensionedScalar with value 1.0 (call it, say, dimensionConversionAB) that has the dimensions required to convert from the dimensions of A*B to the dimensions you require. That way you don't forget that you're doing something a bit dodgy when you come to look back at your code.
__________________
Laurence R. McGlashan :: Website |
|
April 2, 2015, 04:05 |
|
#4 | |
New Member
Panagiotis Giannatselis
Join Date: Jan 2015
Location: Athens, Greece
Posts: 5
Rep Power: 11 |
Quote:
dimensionSet(1,0,-1,0,0,0,0) is the correct.... a "," was misssing |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calculate volume average of volScalarField | tangd | OpenFOAM Running, Solving & CFD | 3 | May 1, 2013 13:37 |
syntax error on config.h | ehooi | Fluent UDF and Scheme Programming | 3 | November 9, 2011 10:05 |
A question about the source code of realizableKE.C | yuhai | OpenFOAM Programming & Development | 1 | June 26, 2009 08:05 |
Nonuniform boundary syntax | juho | OpenFOAM Running, Solving & CFD | 1 | December 11, 2008 16:13 |
error while compiling the USER Sub routine | CFD user | CFX | 3 | November 25, 2002 15:16 |