Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Total temperature boundary cannot be set in the Tt file when using hy2foam #166

Open
Rockyuo666 opened this issue Nov 11, 2024 · 1 comment

Comments

@Rockyuo666
Copy link

Total temperature boundary cannot be set in the Tt file when using hy2foam,but can be set in Tv file.Why it happens?

@timeExplore
Copy link

I am using hyStrath code in OpenFOAM-v1706. You can see the following code of fixed2EnergyFvPatchScalarField::updateCoeffs() in src/thermophysicalModels/strath/strathReactionThermo/reactionThermo/derivedFvPatchFields/fixedEnergy/fixed2EnergyFvPatchScalarField.C
` if (updated())
{
return;
}

//Info<< "fixed2Energy is used for patch called "
//    << patch().name() << endl;

const multi2Thermo& multiThermo = multi2Thermo::lookup2Thermo(*this);

const label patchi = patch().index();

const fvPatchScalarField& pw = multiThermo.p().boundaryField()[patchi];
const fvPatchScalarField& Tw = multiThermo.T().boundaryField()[patchi];

tmp<scalarField> thet(new scalarField(pw.size()));
tmp<scalarField> thevel(new scalarField(pw.size()));

scalarField& het = thet.ref();
scalarField& hevel = thevel.ref();

het = 0.0;
hevel = 0.0;

forAll(thermo_.composition().species(), speciei)
{
    const fvPatchScalarField& spYw =
        thermo_.composition().Y(speciei).boundaryField()[patchi];
    const fvPatchScalarField& spTvw =
        thermo_.composition().Tv(speciei).boundaryField()[patchi];

    het += spYw*thermo_.composition().het(speciei, pw, Tw, patchi);
    hevel += spYw*thermo_.composition().hevel(speciei, pw, spTvw, patchi);
}

operator==(het + thevel);

fixedValueFvPatchScalarField::updateCoeffs();`

Compared with the similar code in the original OpenFOAM-v1706 code, there seems to be no code like "Tw.evaluate();", I think this is the reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants