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

Access species thermo functions from chtMultiRegionFoam bouandray condition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 16, 2020, 13:13
Default Access species thermo functions from chtMultiRegionFoam bouandray condition
  #1
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
Hello,

I am trying to access the species thermo functions, especially HE and Cp/Cv, from within a boundary condition for chtMultiRegionFoam.

The starting point is this boundary condition implemented in OpenFOAM-8: https://github.com/OpenFOAM/OpenFOAM...hScalarField.C

Depending, on which side of the wall the solver is, there is either a fluid or a solid thermo model.

For the fluid side, I was able to access the methods using this (pseudo) code:
Code:
    if (mesh.foundObject<rhoReactionThermo>(basicThermo::dictName))
    {
        const rhoReactionThermo& nbrThermo =
            mesh.lookupObject<rhoReactionThermo>(basicThermo::dictName);

        const basicSpecieMixture& composition = nbrThermo.composition();
        const PtrList<volScalarField>& Y = composition.Y();

//        Info<<"Y.size: " << Y.size() << endl;

        forAll(TList, faceI) {
            scalar he = 0;
            scalar Cpv = 0;
            if (Y.size() > 0) {
                forAll(Y, componentI) {
                    scalar Yi = Y[componentI].boundaryField()[samplePatchi][faceI];
                    he += Yi*composition.HE(
                        componentI, nbrPPatch[faceI], TList[faceI]
                    );
                    Cpv += Yi*composition.Cp(
                        componentI, nbrPPatch[faceI], TList[faceI]
                    );
                }
            }
            else
            {
                scalar Yi = 1;
                he += Yi*composition.HE(
                    0, nbrPPatch[faceI], TList[faceI]
                );
                Cpv += Yi*composition.Cp(
                    0, nbrPPatch[faceI], TList[faceI]
                );
            }
    }
One thing, I do not really understand is the case, where I have a pureMixture and then, Y() returns a list of length zero. Nevertheless, if I use the index 0 for the access of the methods, it seems to work. Why?

On the solid side, I was not able to get hold on any "composition". I tried something like this:
Code:
        const solidThermo& nbrThermo = 
            nbrMesh.lookupObject<solidThermo>(basicThermo::dictName);
but solidThermo does not have a composition() method. Looking in the source code, there is a class heSolidThermo using the methods HE and Cp, but I was not able to use it, because I did not find correct template arguments to create a reference and assigning something inside the objectRegistry to this reference.

Is there a way to access this compositon/mixture methods of a solid?

Thank you for any help
Joachim
jherb is offline   Reply With Quote

Old   October 16, 2020, 17:00
Default
  #2
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 15
clapointe is on a distinguished road
I've been working through similar issues recently, I think. I'm not sure about accessing composition/etc for solidThermo, but what I've done is use a solid reaction thermo... you could use it without reactions, and it should provide a means to use a multi-component (homogenous) mixture if desired. Then you can access using something like :

Code:
solidReactionThermo& solidThermo = solidThermos[i];
basicSpecieMixture& composition = solidThermo.composition();
PtrList<volScalarField>& Ys = composition.Y();
This assumes that you open to using a version different from OpenFOAM 8 (for which the solid reactions are in some phase of restructuring). I suppose another option is to port solidReactionThermo from 7 to 8...

Caelan
clapointe is offline   Reply With Quote

Old   October 16, 2020, 17:52
Default
  #3
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
Thank you for your answer. Unfortunately, I would like to do this in OpenFOAM-8. And solidReactionThermo was completely removed in this version.
jherb 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
Species Transport Boundary Condition Nishant_Sharma FLUENT 2 June 1, 2018 03:16
controlDict dynamic functions for chtMultiRegionFoam Mhmnabil OpenFOAM Running, Solving & CFD 0 October 25, 2017 15:22
Define functions for Boundary Condition of Thermal Problems in Ansys cyrusIII ANSYS 0 October 16, 2016 18:50
JANAF thermo, species with different Tcommon adhiraj OpenFOAM 4 March 10, 2014 10:51
CFX fails to calculate a diffuser pipe flow shenying0710 CFX 7 March 26, 2013 05:13


All times are GMT -4. The time now is 03:53.