CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

How to get a single value from a volScalarField including the dimension

Register Blogs Community New Posts Updated Threads Search

Like Tree11Likes
  • 3 Post By tomislav_maric
  • 4 Post By olesen
  • 2 Post By laurensvd
  • 1 Post By sfigato
  • 1 Post By Garfield

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 27, 2011, 08:17
Default How to get a single value from a volScalarField including the dimension
  #1
New Member
 
Sam Fredriksson
Join Date: Dec 2010
Posts: 20
Rep Power: 15
safre is on a distinguished road
Hello

I have problems getting the dimension correct when I am doing a simple sum. My equation is:

aveTSlab = aveTSlab + T[n];

where

aveTSlab is defined as

dimensionedScalar aveTSlab
(
"aveTSlab",
dimensionSet( 0, 0, 0, 1, 0, 0, 0),
scalar( 0)
);

and

volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ
),
mesh
);

Both dimensions are defined correctly but when I take a single value T[n] it does not come with any dimension but the error is as:

--> FOAM FATAL ERROR:
LHS and RHS of + have different dimensions
dimensions : [0 0 0 1 0 0 0] + [0 0 0 0 0 0 0]

Please give advise how to get a single value from a volScalarField including the dimension.
safre is offline   Reply With Quote

Old   October 27, 2011, 09:17
Default
  #2
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21
tomislav_maric is on a distinguished road
Quote:
Originally Posted by safre View Post
Hello

...

and

volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ
),
mesh
);
Nope, the dimensions of the volScalarField are not set correctly, try this:

Code:
volScalarField T
    (
             IOobject
             (
                     "T",
                     runTime.timeName(), 
                     mesh,
                     IOobject::MUST_READ
             ),
             mesh, 
             dimensionedScalar
             (
                  "0", // a dummy name for the scalar
                  dimTemperature, // 00051 extern const dimensionSet dimTemperature; - preset global constant dimensionSet for the temperature
                   pTraits<scalar>::zero  // trait for the zero value of scalar
             )
    );
tomislav_maric is offline   Reply With Quote

Old   October 27, 2011, 10:34
Default Thank you for your suggestion but it did not help me out.
  #3
New Member
 
Sam Fredriksson
Join Date: Dec 2010
Posts: 20
Rep Power: 15
safre is on a distinguished road
Thank you for your suggestion but it did not help me out.

In a way I still do not think it is a problem in the definition of T since that is only read from the ordinary Temperature file from my time directory and if I print out the complete T field the dimension is correct. The problem starts when I try to get one single value out of the field. I guess there is some command to do it another way than I am trying?

In fact what I really want to do is to take an average of a part of a volScalarField something like

TSlab = cmptAv(T(n0-nN));

or

TSlab = average(T(n0-nN));

including the dimension with n0 as the first value in a part of field T and nN being the last value in the part. Perhaps there is an even quicker solution to that problem?

Regards, Sam
safre is offline   Reply With Quote

Old   October 27, 2011, 11:51
Default
  #4
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21
tomislav_maric is on a distinguished road
I think I've found the reason for this.

When you look in the following classes:

GeometricField<Type, PatchField, GeoMesh> -> DimensionedField< Type, GeoMesh> ->
Field< T > -> List < T > -> UList < T>, you will find that the access operator has not been redefined all the way since UList < T >:

Code:
T & operator[] (const label)
Wich will just return a scalar. So, each time you call T[label], you won't get a dimensionedScalar, but a scalar. To avoid this, you may define your own access operator [] for the GeometricField (this will probably mess up a lot of things), or you can deal with values...

meaning that this should help:

Code:
    scalar& aveTSlabVal = aveTSlab.value();
    
    aveTSlabVal = T[0];
You can even call
Code:
aveTSlab.val() = T[0]
if you like.
tomislav_maric is offline   Reply With Quote

Old   October 28, 2011, 03:41
Default
  #5
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by safre View Post
Hello

I have problems getting the dimension correct when I am doing a simple sum. My equation is:

aveTSlab = aveTSlab + T[n];

where

aveTSlab is defined as

dimensionedScalar aveTSlab
(
"aveTSlab",
dimensionSet( 0, 0, 0, 1, 0, 0, 0),
scalar( 0)
);

and

volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ
),
mesh
);

Both dimensions are defined correctly but when I take a single value T[n] it does not come with any dimension but the error is as:

--> FOAM FATAL ERROR:
LHS and RHS of + have different dimensions
dimensions : [0 0 0 1 0 0 0] + [0 0 0 0 0 0 0]

Please give advise how to get a single value from a volScalarField including the dimension.
Once you understand the volFields it will make more sense.
A volField is essentially a list of normal values that is augmented by a dimension. It is not a list of dimensioned values.
The means that any dimension checking is only done once for the entire field and not for each value.

In accordance with this, the
Code:
operator[]
will return the plain, undimensioned value. Thus the easiest and most efficient is to use the plain values directly
Code:
aveTSlab.value() += T[n];
If you really prefer to work with dimensioned values (and have dimensioning checking for each addition operation within the loop!!), try something like this:

Code:
aveTSlab += dimensionedScalar("T", T.dimensions(), T[n]);
For ease and generality, you will probably want to declare aveTSlab using the same dimensions as "T":
Code:
 
dimensionedScalar aveTSlab
(
    "aveTSlab",
    T.dimensions(),
    pTraits<Scalar>::zero
);
y_jiang, mbookin, B_Li and 1 others like this.
olesen is offline   Reply With Quote

Old   October 28, 2011, 04:44
Smile
  #6
New Member
 
Sam Fredriksson
Join Date: Dec 2010
Posts: 20
Rep Power: 15
safre is on a distinguished road
Hello

Yes that works or even simpler using an ordinary double definition. It was just that I wanted to keep the dimensions in order to keep the dimension check in my coding.

The way I solved it now is to use a double inside the calculation and then do a nn.write(); to a correctly dimensioned volScalarFieldaveTz in the end as

aveTz[k]= some value without dimension
aveTz.write();

It works but it could have been more elegant.

Thanks for all your help, Sam
safre is offline   Reply With Quote

Old   October 28, 2011, 05:41
Default
  #7
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21
tomislav_maric is on a distinguished road
Quote:
Originally Posted by safre View Post
Hello

Yes that works or even simpler using an ordinary double definition. It was just that I wanted to keep the dimensions in order to keep the dimension check in my coding.

The way I solved it now is to use a double inside the calculation and then do a nn.write(); to a correctly dimensioned volScalarFieldaveTz in the end as

aveTz[k]= some value without dimension
aveTz.write();

It works but it could have been more elegant.

Thanks for all your help, Sam
Dimension checks, based on this information, are kept only for the fields, since as soon as one wants to access a DimensionedField<Type, GeoMesh> element, a Type is returned, instead of Dimensioned<Type>. This is good when one assembles field equations and performs computations on fields, not on specific elements. This means that +,/,* operators on GeometricField have built in dimension checks.

What you are describing here is an addition of value, not a complex equation involving fields: OpenFOAM is all about working with fields. I'm doing a lot of cell local explicit computation myself and the farther I get from manipulating the fields using their operators and numerics that is already there, the more problems I get into.

Anyway, good luck.
tomislav_maric is offline   Reply With Quote

Old   March 1, 2012, 10:41
Default
  #8
Senior Member
 
calim_cfd's Avatar
 
mauricio
Join Date: Jun 2011
Posts: 172
Rep Power: 18
calim_cfd is on a distinguished road
hihi!

within this scope.. can any1 please tell me what am i missing?

i wanna change the dimensions of wallHeatFlux so i can operate with T.

I figured this should work:
Code:
volScalarField wallHeatFlux(wallHeatFluxheader, mesh);

        wallHF += dimensionedScalar("wallHF", T.dimensions(), wallHeatFlux);
i get the error:
Code:
conVh.C: In function ‘int main(int, char**)’:
conVh.C:166:3: error: ‘wallHF’ was not declared in this scope
thanks in advance!
calim_cfd is offline   Reply With Quote

Old   March 1, 2012, 10:50
Default
  #9
Member
 
Laurens Van Dyck
Join Date: Jul 2011
Location: Netherlands/Germany
Posts: 34
Rep Power: 15
laurensvd is on a distinguished road
You never defined what type wallHF is, you need to add volScalarField in front of wallHF +=...

what you can also do is reset the dimensions of wallHeatFlux to something different like so:
wallHeatFlux.dimensions().reset(T.dimensions());
MaLa and lpz456 like this.
laurensvd is offline   Reply With Quote

Old   March 1, 2012, 14:45
Default
  #10
Senior Member
 
calim_cfd's Avatar
 
mauricio
Join Date: Jun 2011
Posts: 172
Rep Power: 18
calim_cfd is on a distinguished road
Quote:
Originally Posted by laurensvd View Post
You never defined what type wallHF is, you need to add volScalarField in front of wallHF +=...

what you can also do is reset the dimensions of wallHeatFlux to something different like so:
wallHeatFlux.dimensions().reset(T.dimensions());

hi lauren!

Thanks a lot for replying..

but i guess the units error im getting comes from the sum (T - 300)

I guess i gotta set dimension to that 300... i've tried to find sth on the forums but so far nothing.. any ideas?

i tried a few syntax too but few would work... this one works:

scalar Tam = 300; and i set the sum to (T- Tam) .. the app compiles but the error is there.. ill keep digging

thanks once again!



EDIT:

i guess i got it..:

dimensionedScalar Tam ("Tam", dimensionSet(0, 0, 0, 1, 0, 0, 0),300.0);

now im getting other erros,

but again TY!!!!!

Last edited by calim_cfd; March 1, 2012 at 14:53. Reason: solution found
calim_cfd is offline   Reply With Quote

Old   March 25, 2013, 05:33
Default
  #11
Senior Member
 
sfigato's Avatar
 
Marco Longhitano
Join Date: Jan 2013
Location: Aachen
Posts: 103
Rep Power: 13
sfigato is on a distinguished road
Send a message via Skype™ to sfigato
Hi Foamers,

I would like to implement a new cavitation solver in openFoam! I added a transport equation for mass fraction where I need to compare my local pressure (p) with a scalar experimental value pEq!

During the compiling of the code I got a dimension error!
Can anyone help me to fix it?

Here is the transport equation code:


Quote:
// Solve Mass Fraction Equation for the Gas Air (undissolved)
{
#include "sourceTerms.H"

//Scalar Transport Equation for Mass Fraction
if (pEq > p) //p)
{
fvScalarMatrix f4Eqn
(
fvm::ddt(rho, f4)
+ fvm::div(rhoPhi /*phi*/, f4)
- fvm::laplacian(Gamma4,f4)
//+ fvm::Sp(AaL,f4)
+ fvm::Sp(AdL,f4)

);

f4Eqn.relax();
solve( f4Eqn /*== AaL*fGlim*/);
}
else
{
fvScalarMatrix f4Eqn
(
fvm::ddt(rho, f4)
+ fvm::div(rhoPhi /*phi*/, f4)
- fvm::laplacian(Gamma4,f4)
+ fvm::Sp(AaL,f4)
//+ fvm::Sp(AdL,f4)

);

f4Eqn.relax();
solve( f4Eqn == AaL*fGlim);
}

//Update of All Phases Coeffcients
//rho == scalar(1)/((f1+f4)/rho1 + f2/rho2 + f3/rho3);
//rhoPhi == rho*phi;
}
Here the declarations for pEq and p

Quote:
Info<< "Reading thermodynamicProperties\n" << endl;

IOdictionary thermodynamicProperties
(
IOobject
(
"thermodynamicProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);

dimensionedScalar pEq(thermodynamicProperties.lookup("pEq"));
Quote:
Info<< "Reading field p\n" << endl;
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
The compiling error is:

Quote:
Making dependency list for source file ifasFCMfoam.C
Making dependency list for source file incompressibleFourPhaseMixture/fourPhaseMixture.C
SOURCE=ifasFCMfoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/turbulenceModels/incompressible/turbulenceModel -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/transportModels -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/meshTools/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/ifasFCMfoam.o
In file included from ifasFCMfoam.C:76:0:
f4Eqn.H: In function ‘int main(int, char**)’:
f4Eqn.H:6:11: error: no match for ‘operator>’ in ‘pEq > p’
f4Eqn.H:6:11: note: candidates are:
In file included from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/VectorSpace.H:164:0,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionedType.H:41,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionedScalar.H:38,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/TimeState.H:38,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Time.H:47,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvCFD.H:6,
from ifasFCMfoam.C:36:
/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/VectorSpaceI.H:650:13: note: template<class Form, class Cmpt, int nCmpt> bool Foam:perator>(const Foam::VectorSpace<Form, Cmpt, nCmpt>&, const Foam::VectorSpace<Form, Cmpt, nCmpt>&)
/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/VectorSpaceI.H:650:13: note: template argument deduction/substitution failed:
In file included from ifasFCMfoam.C:76:0:
f4Eqn.H:6:11: note: ‘Foam::dimensionedScalar {aka Foam::dimensioned<double>}’ is not derived from ‘const Foam::VectorSpace<Form, Cmpt, nCmpt>’
In file included from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionedType.H:298:0,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionedScalar.H:38,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/TimeState.H:38,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/Time.H:47,
from /opt/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvCFD.H:6,
from ifasFCMfoam.C:36:
/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionedType.C:450:6: note: template<class Type> bool Foam:perator>(const Foam::dimensioned<Type>&, const Foam::dimensioned<Type>&)
/opt/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/dimensionedType.C:450:6: note: template argument deduction/substitution failed:
In file included from ifasFCMfoam.C:76:0:
f4Eqn.H:6:11: note: ‘Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ is not derived from ‘const Foam::dimensioned<Type>’
In file included from ifasFCMfoam.C:49:0:
createFields.H:106:30: warning: unused variable ‘rho4’ [-Wunused-variable]
make: *** [Make/linux64GccDPOpt/ifasFCMfoam.o] Fehler 1
paddy.here likes this.
sfigato is offline   Reply With Quote

Old   March 20, 2016, 20:07
Default how to convert from ‘Foam::scalarField {aka Foam::Field<double>}’ to ‘bool’
  #12
New Member
 
Fei
Join Date: Oct 2015
Posts: 13
Rep Power: 11
Garfield is on a distinguished road
Hi,
I am a new guy in C++

I need to compare the T value from the boundary field with my Tin( a constant), with if() function, like if (T.boundaryField()[patchi]-T_initial), however it keep saying " cannot convert from ‘Foam::scalarField {aka Foam::Field<double>}’ to ‘bool’ "

Anyone knows how to handle that?

Thanks a lot!
Garfield
paddy.here likes this.
Garfield is offline   Reply With Quote

Old   April 16, 2016, 21:37
Default
  #13
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
santiagomarquezd will become famous soon enough
Well,
Quote:
Originally Posted by Garfield View Post

if (T.boundaryField()[patchi]-T_initial), however it keep saying " cannot convert from ‘Foam::scalarField {aka Foam::Field<double>}’ to ‘bool’ "
I think you are trying to do something like

Code:
if (T.boundaryField()[patchi] == T_initial)
but it is not possible since T.boundaryField()[patchi] will give you an scalarField (many values). If you want to know if all values are equal to your T_initial value try something like this:

Code:
scalarField bData = T.boundaryField()[patchi];
bool equal = 1;

forAll(bData, datai)
{
    if (bData[datai] != T_ini)
    {
        equal = 0;
        break;
    }
}
if you have 1 at the final of run all the values in the patch are equal to T_ini.

Regards!
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   April 18, 2016, 14:11
Default
  #14
New Member
 
Fei
Join Date: Oct 2015
Posts: 13
Rep Power: 11
Garfield is on a distinguished road
Hi Santiago
That 's work!!! I really Thanks a lot for your help!
I also have another question, I think may be you can help me. My test section consists of two parts, and they are connected by two channels in the middle. I want to know the mass flow rate through each of the connection channels. Because there is no face located there in the mesh, the patchAverage function seems not work, so you have any suggestion for me? (I also attached the image of my test section here)
Thanks again
Best
Garfield
Attached Images
File Type: png image.png (9.7 KB, 56 views)
Garfield is offline   Reply With Quote

Old   April 18, 2016, 22:16
Default
  #15
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
santiagomarquezd will become famous soon enough
Hi, you have faces there but no patches. Do you want to compute the flux at running time or in postprocessing?
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   April 19, 2016, 11:36
Default
  #16
New Member
 
Fei
Join Date: Oct 2015
Posts: 13
Rep Power: 11
Garfield is on a distinguished road
Hi Santiago,
Thanks for your quick reply.
I'm sorry that I didn't state my question clear. Actually, the air flows from the lower channel to the upper channel through the two connection column ( the two I marked in the drawing), I want to know the mass flow rate through the each of the two connection column in my postprocessing.
Thanks a lot!
Best
Garfield
Garfield is offline   Reply With Quote

Old   May 17, 2016, 12:13
Default
  #17
Member
 
Join Date: Oct 2015
Posts: 63
Rep Power: 11
Scram_1 is on a distinguished road
Hey,
I've tried to create a new viscosity model. While running a case using the modified icoFoam solver (it's modified to solve for the energy equation), I'm getting the following error(s)

Selecting incompressible transport model TempViscosityModel


--> FOAM FATAL ERROR:
LHS and RHS of - have different dimensions
dimensions : [0 0 0 1 0 0 0] - [0 0 0 0 0 0 0]


From function operator-(const dimensionSet&, const dimensionSet&)
in file dimensionSet/dimensionSet.C at line 499.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam:perator-(Foam::dimensionSet const&, Foam::dimensionSet const&) at ??:?
#3 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam:perator-<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensioned<double> const&) at ??:?
#4 Foam::viscosityModels::TempViscosityModel::calcNu( ) const at ??:?
#5 Foam::viscosityModels::TempViscosityModel::TempVis cosityModel(Foam::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#6 Foam::viscosityModel::adddictionaryConstructorToTa ble<Foam::viscosityModels::TempViscosityModel>::Ne w(Foam::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#7 Foam::viscosityModel::New(Foam::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#8 Foam::singlePhaseTransportModel::singlePhaseTransp ortModel(Foam::GeometricField<Foam::Vector<double> , Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#9
at ??:?
#10 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#11
at ??:?
Aborted (core dumped)
[ATTACH]TempViscosityModel.H[/ATTACH]
Attached Files
File Type: c TempViscosityModel.C (3.3 KB, 7 views)
Scram_1 is offline   Reply With Quote

Old   May 17, 2016, 12:18
Default
  #18
Member
 
Join Date: Oct 2015
Posts: 63
Rep Power: 11
Scram_1 is on a distinguished road
And here is my transportProperties file

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 3.0.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel TempViscosityModel;
nu nu [0 2 -1 0 0 0 0] 0.001;
DT DT [0 2 -1 0 0 0 0] 0.002;


TempViscosityModelCoeffs
{
vf1 vf1 [ 0 0 0 0 0 0 0 ] 1;
vf2 vf2 [ 0 0 0 0 0 0 0 ] 0.06;

}
// ************************************************** *********************** //
Any suggestions on how to resolve this issue??

Thanks!!
Ram
Scram_1 is offline   Reply With Quote

Old   May 20, 2016, 09:01
Default
  #19
New Member
 
Join Date: Oct 2014
Posts: 26
Rep Power: 12
teuk is on a distinguished road
Hi Ram,

maybe it's the missing dimensionSet in your nu_ definition?

Code:
    nu_ 
    ( 
        IOobject 
        ( 
            name, 
            U_.time().timeName(), 
            U_.db(), 
            IOobject::NO_READ, 
            IOobject::AUTO_WRITE 
        ), 
        calcNu() 
    )
regards,
teuk
teuk is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
if-loop, volScalarField comparison volker OpenFOAM 7 March 6, 2020 21:03
Including Two Reactions in single UDF..!! sri31049 Fluent UDF and Scheme Programming 10 June 14, 2013 22:42
Single Droplet_VOF ANSYS 13 MDinc FLUENT 0 July 19, 2011 15:14
How to export single variable of a single surface? zeitistgeld CFX 6 September 26, 2009 07:37
P4 1.5 or Dual P3 800EB on Gibabyte board Danial FLUENT 4 September 12, 2001 12:44


All times are GMT -4. The time now is 14:33.