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

Can't create VolScalarField based on a Dimensioned Scalar

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 23, 2014, 09:29
Default Can't create VolScalarField based on a Dimensioned Scalar
  #1
Member
 
Pedro
Join Date: Nov 2014
Posts: 50
Rep Power: 11
pupo is on a distinguished road
Good Afternoon all!

I'm trying to edit a solver to include Saturation temperature.

I created the following:

Code:
    dimensionedScalar Tsat
    (
        "Tsat",
        dimensionSet(0, 0, 0, 1, 0),
        transportProperties.subDict("phase2").lookup("Tsat")
    );
    

    volScalarField Mlv
    (
        IOobject
        (
            "Mlv",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        alpha2 * rho2 * ( T2 - Tsat)/ Tsat 
    );

    );
the problem is, Mlv is being calculated as a single variable for the entire domain, instead of being calculated for every cell. (AS in the Mlv feels have a single value uniform for all the domain)

i then tried using this approach:
Code:
    dimensionedScalar Tsat
    (
        "Tsat",
        dimensionSet(0, 0, 0, 1, 0),
        transportProperties.subDict("phase2").lookup("Tsat")
    );
    
    volScalarField Tsati("Tsati", Tsat);
which i saw being used by the default solver to make what i want for rho. However this crashes the compiler (which only says: make: *** [Make/linux64GccDPOpt/catarina.o] Error 1 )

I've removed the Mlv part of the code and the 2 lines before still crash by themselves. I've also replaced Tsat in " volScalarField Tsati("Tsati", Tsat);" by some other variable, e.g.: rho, and the code is compiled.

How does one add a VolScalarField based on a single constat?

Best Regards
(i'm using ubunto 12.04 with OF 2.1.1... also i'm a linux noob)
pupo is offline   Reply With Quote

Old   November 23, 2014, 09:49
Default
  #2
Member
 
Pedro
Join Date: Nov 2014
Posts: 50
Rep Power: 11
pupo is on a distinguished road
ok, never mind.....

I forgot to add code to calculate these variables in the runtime loop....

Anyway, my question for the second bit of code still stands... why doesn't it work?

Best Regards
pupo is offline   Reply With Quote

Old   November 23, 2014, 13:54
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Pedro and welcome to the forum!

Quote:
Originally Posted by pupo View Post
However this crashes the compiler (which only says: make: *** [Make/linux64GccDPOpt/catarina.o] Error 1 )
The last line doesn't tell the whole story . Please provide the complete terminal output, including the command you've used to do the compilation.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   November 23, 2014, 17:29
Default
  #4
Member
 
Pedro
Join Date: Nov 2014
Posts: 50
Rep Power: 11
pupo is on a distinguished road
hi bruno

thanks for the reply. I ran the compiler so many times (wclean; wmake) today i failed to notice the text changed when there was an error

the error itself is

/home/pupo/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/GeometricField.C:209:1: note: candidate expects 4 arguments, 2 provided

anyway, i apparently don't need to create a volscalarfield for a static variable, as soon as i added the field i want to calculate into the runtime loop everything starting to work as expected....

Thank you for your time, if you want to clear the forum out of a useless thread... please do :/
pupo 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
FATAL ERROR:Maximum number of iterations exceeded zqlhzx OpenFOAM Running, Solving & CFD 4 July 13, 2016 15:53
Abnormal (?) Passive Scalar behaviour cwl STAR-CCM+ 1 October 3, 2014 08:05
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47
Dimensioned Scalar Help physics1 OpenFOAM Programming & Development 2 January 9, 2014 11:34
Climbing inlet pressure with simpleFoam and directMappedPatches chegdan OpenFOAM Running, Solving & CFD 1 January 2, 2012 19:35


All times are GMT -4. The time now is 17:56.