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

externalCoupledTemperature for incompressible?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 30, 2020, 14:07
Smile externalCoupledTemperature for incompressible?
  #1
Member
 
sibo
Join Date: Oct 2016
Location: Chicago
Posts: 55
Rep Power: 10
sibo is on a distinguished road
Hi Foamers,

There is an boundary condition called externalCoupledTemperature which is used to couple OF solves to other CFD codes. However, it can only be used in compressible solver for now. The reason can be found in the following code. Basically, this BC needs 'he' and 'alpha', which can only be accessed in thermo class in compressible solvers. Since the incompressible solvers solve temperature separately from P/U, it only has this transport class.

Code:
if (db().foundObject<cmpTurbModelType>(turbName))
    {
        const cmpTurbModelType& turbModel =
            db().lookupObject<cmpTurbModelType>(turbName);

        const basicThermo& thermo = turbModel.transport();

        const fvPatchScalarField& hep = thermo.he().boundaryField()[patchi];

        qDot = turbModel.alphaEff(patchi)*hep.snGrad();
    }
    else if (db().foundObject<basicThermo>(thermoName))
    {
        const basicThermo& thermo = db().lookupObject<basicThermo>(thermoName);

        const fvPatchScalarField& hep = thermo.he().boundaryField()[patchi];

        qDot = thermo.alpha().boundaryField()[patchi]*hep.snGrad();
    }
    else
    {
        FatalErrorInFunction
            << "Condition requires either compressible turbulence and/or "
            << "thermo model to be available" << exit(FatalError);
    }if (db().foundObject<cmpTurbModelType>(turbName))
    {
        const cmpTurbModelType& turbModel =
            db().lookupObject<cmpTurbModelType>(turbName);

        const basicThermo& thermo = turbModel.transport();

        const fvPatchScalarField& hep = thermo.he().boundaryField()[patchi];

        qDot = turbModel.alphaEff(patchi)*hep.snGrad();
    }
    else if (db().foundObject<basicThermo>(thermoName))
    {
        const basicThermo& thermo = db().lookupObject<basicThermo>(thermoName);

        const fvPatchScalarField& hep = thermo.he().boundaryField()[patchi];

        qDot = thermo.alpha().boundaryField()[patchi]*hep.snGrad();
    }
    else
    {
        FatalErrorInFunction
            << "Condition requires either compressible turbulence and/or "
            << "thermo model to be available" << exit(FatalError);
    }
Now I need to use it in incompressible solvers, I want to modify this boundary condition. But I'm not sure how to give it the 'he' and 'alpha' in an incompressible solver.

Any suggestion is welcome. Thanks in advance!
sibo is offline   Reply With Quote

Old   October 3, 2020, 11:32
Default
  #2
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
Did you try to use a compressible solver but choosing a constant density and in the thermodynamic package. See https://cfd.direct/openfoam/user-gui...hermophysical/
mAlletto is offline   Reply With Quote

Reply

Tags
externalcoupled, incompressible, thermo


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



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