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

Units in addSups fvOption

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 30, 2020, 09:37
Default Units in addSups fvOption
  #1
New Member
 
Join Date: Jun 2020
Posts: 5
Rep Power: 6
fnovo is on a distinguished road
Dear Foamers,


I am facing an issue with the source classes at the moment. It's probably just one little mistake I made or something I don't understand.

Right now I am trying to write a class for battery heating. This is supposed to be used by the fvOptions dictionary. So far it works, but I am uncertain about the units,
The following code is the one I am talking about.
Code:
scalarField& heSource = eqn.source();
Info<<"eqn dimension "<<eqn.dimensions()<<nl;
Info<<"heatFlow dimension "<<heatFlow.dimensions()<<nl;
heSource-=heatSource;
So far, the heat source term has the unit W. According to the log file, eqn has the unit W as well. So this code works. Yesterday I tried to change it as followed:

Code:
scalarField& heSource = eqn.source();
Info<<"eqn dimension "<<eqn.dimensions()<<nl;
Info<<"heatFlow dimension "<<heatFlow.dimensions()<<nl;
eqn-=heatSource;
Using the changed class as a source term gives me the error message
Code:
--> FOAM FATAL ERROR: 

    [h[1 -1 -3 0 0 0 0] ] -= [heatFlow[1 2 -3 0 0 0 0] ]

    From function void Foam::checkMethod(const Foam::fvMatrix<Type>&, const Foam::DimensionedField<Type, Foam::volMesh>&, const char*) [with Type = double]
    in file /home/student-ift/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude/fvMatrix.C at line 1304.
What is the issue with the new code? Is OpenFoam somehow asuming to get the source term in W when using ern.source()? Or am I even allowed to calculate the source term in W?

I couldn't find any answers to my question so far. I hope someone can help me out



Kind regards,
Frederik
fnovo is offline   Reply With Quote

Old   October 5, 2020, 06:05
Default
  #2
New Member
 
Join Date: Jun 2020
Posts: 5
Rep Power: 6
fnovo is on a distinguished road
Is there no one with an idea regarding this? I tried to find the definition of source() in the fvMatrix code. But it seems like, this function is just returning the variable source_.


Code from fvMatrix.H:
Code:
         //- Source term 
         Field<Type> source_;

Code:
             Field<Type>& source()
 
             {
 
                 return source_;
 
             }
 
  
 
             const Field<Type>& source() const
 
             {
 
                 return source_;
 
             }

Unfortunately, I cannot find the definition of source_ or any hints regarding the dimension...
I hope that someone came across this problem ealier
fnovo 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
fvOptions() Options and SemiImplicit Source Term - Units Tobi OpenFOAM Programming & Development 11 February 18, 2021 10:13
Thermophysical Property Units johanz OpenFOAM Pre-Processing 2 December 16, 2018 11:08
Writing XY plots with Non-SI units Akhundzada91 FLUENT 0 August 27, 2013 12:11
units in OpenFOAM megacrout OpenFOAM 4 July 19, 2011 09:04
Mass transfer units in fluent nite_surfer FLUENT 0 July 12, 2007 13:51


All times are GMT -4. The time now is 20:58.