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

Adding a Constructor to ThermoCloud

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 4, 2023, 22:15
Default Adding a Constructor to ThermoCloud
  #1
New Member
 
Caleb Schrad
Join Date: Jun 2021
Location: West Lafayette, IN
Posts: 2
Rep Power: 0
schradc is on a distinguished road
Hello,

I have a novice question, I'm not quite sure how to articulate it.

I need to modify the ThermoCloud class to add a constructor with a modified list of arguments. Presently the constructor takes these arguments

Code:
        ThermoCloud
        (
            const word& cloudName,
            const volScalarField& rho,
            const volVectorField& U,
            const dimensionedVector& g,
            const SLGThermo& thermo,
            bool readFields = true
        );
I need to avoid passing an instance of SLGThermo and instead pass select data it contained individually.

Initially, I wanted to create a copy of ThermoCloud with the same inheritance and add the custom constructor, but there is a hitch.

src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H

Code:
#define makeHeatTransferModel(CloudType)                                       \
                                                                               \
    typedef Foam::CloudType::thermoCloudType thermoCloudType;                  \
    defineNamedTemplateTypeNameAndDebug                                        \
    (                                                                          \
        Foam::HeatTransferModel<thermoCloudType>,                              \
        0                                                                      \
    );                                                                         \
    namespace Foam                                                             \
    {                                                                          \
        defineTemplateRunTimeSelectionTable                                    \
        (                                                                      \
            HeatTransferModel<thermoCloudType>,                                \
            dictionary                                                         \
        );                                                                     \
    }
If I am understanding this correctly, the runTimeSelction stuff for the HeatTransferModel (and derived) can only be done for cloud classes which are templated based on and are derived from a ThermoCloud. Which means that no matter what I do, I will have to at some point construct a ThermoCloud using the SLGThermo constructor.

I could use some advice on how to proceed.
  1. Do I need to modify the heat transfer runTimeSelection macros to work with a custom "ThermoCloud adjacent" class?
  2. Can/should I add a constructor to the actual ThermoCloud class instead of deriving from it?
  3. Can I set the data inherited from ThermoCloud without using the ThermoCloud SLGThermo constructor? Perhaps using the default constructor? If I do, how do I construct the KinematicCloud on which ThermoCloud is based?

Thanks for taking a look.
schradc is offline   Reply With Quote

Reply

Tags
constructor, derived parts, inherited parts, macros, thermocloud


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
chtMultiRegionFoam solver stops without any error amol_patel OpenFOAM Running, Solving & CFD 4 July 5, 2024 02:41
2 ways to mesh a multiRegion case - one works, the other fails boffin5 OpenFOAM Running, Solving & CFD 16 March 27, 2023 13:58
FOAM FATAL ERROR: Cannot find file "points" in directory "shell/polyMesh" amol_patel OpenFOAM Pre-Processing 22 October 29, 2021 14:34
multiRegionHeater error ordinary OpenFOAM Running, Solving & CFD 2 June 9, 2020 18:43
conjugateHeatFoam + interFoam farhagim OpenFOAM Programming & Development 15 July 19, 2016 08:55


All times are GMT -4. The time now is 16:12.