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

add method to rhoThermo ... SOLVED

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 25, 2018, 06:22
Default add method to rhoThermo ... SOLVED
  #1
Member
 
Kristjan
Join Date: Apr 2017
Location: Slovenia
Posts: 36
Rep Power: 8
krikre is on a distinguished road
I had the following question written but then I checked doxygen and solved it. I thought I'd share it for anyone else. I hope it helps someone.

Quote:
I'm trying to add a new method to calculate thermal expansion in my thermo models. I'd like to call it in the twoPhaseMixtureThermo.C, like Cv().

I thought all the methods called in twoPhaseMixtureThermo.C were defined in heThermo.C. But if I add a new method in heThermo.C and try to call it in twoPhaseMixtureThermo.C I get a compliation error:

Code:
mojTwoPhaseMixtureThermo/mojTwoPhaseMixtureThermo.C: In member function 'virtual Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::mojTwoPhaseMixtureThermo::cTExp() const':
mojTwoPhaseMixtureThermo/mojTwoPhaseMixtureThermo.C:357:28: error: 'const class Foam::mojRhoThermo' has no member named 'cTExp'
         alpha1()*thermo1_->cTExp(); // coef. of therm. expan. for thermo1
The clases were copied and renamed with a prefix "moj". I'm confidend this isn't the probelm. The solver I'm modifying is here.
It compiled after I added a virtual method to basicThermo.H.

Code:
            //- Thermal expnansion coef. [1/K]
            virtual tmp<volScalarField> cTExp() const = 0;
I think it's because the code is referencing the derived classes via the abstract base class pointer.

(The thermal expansion is actually defined in the equation of state class as a function of temperature and pressure and then inherited to hThermo where it is used to define a tmp<volScalarField>.)
krikre is offline   Reply With Quote

Old   April 26, 2018, 05:49
Default swak4Foam for openfoam 5
  #2
New Member
 
Patrick
Join Date: Apr 2016
Posts: 10
Rep Power: 9
linox is on a distinguished road
Hi,

I am searching for Swak4Foam for OpenFOAM 5 but could not find anything online.
Perhaps someone here could help me to this regard. Is there a swake4Foam version for openfoam 5?

Thanks,
Linox
linox 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
Finite element method ANSYS CFX tomd97 CFX 2 April 4, 2018 04:10
Solution method michimichi88 Fluent Multiphase 0 May 13, 2015 11:35
fluid flow but temperature raises from nowhere? mxcfd STAR-CCM+ 5 September 16, 2014 05:46
About flowfield-dependent variation(FDV) method? Jinwon Main CFD Forum 1 December 4, 2007 21:13
Add Measure Markings or Coordinates to the Contour Colin FLUENT 4 August 25, 2004 09:54


All times are GMT -4. The time now is 11:49.