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

Boundary Conditions: How is temperature modified in constHTemperatureRadiationFvPatch

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 1 Post By mehtab
  • 2 Post By mturcios777
  • 1 Post By mehtab
  • 1 Post By jherb
  • 1 Post By mehtab

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 28, 2015, 10:08
Default Boundary Conditions: How is temperature modified in constHTemperatureRadiationFvPatch
  #1
Member
 
Mehtab
Join Date: Jan 2015
Posts: 41
Rep Power: 11
mehtab is on a distinguished road
Hi Foames,

Can anybody help me understand how temperature is being modified here? This is a part of code being implemented for modifying temperature at a pacth.

Code:
void Foam::constHTemperatureRadiationFvPatchScalarField::updateCoeffs()
{

    if (this->updated())
    {
        return;
    }

    // const scalarField K_ = patch().lookupPatchField<volScalarField, scalar>("K");
    
    const scalar sigma = constant::physicoChemical::sigma.value();
    
    
    forAll(*this, i)
    {
        const scalar T = operator[](i);

        // positive heat flux heats solid, negative cools solid
        // convection
        const scalar qConv = h_[i]*(Tinf_[i] - T);

        // radiation
        const scalar absorptivity = emissivity_[i];
        const scalar emissivitySurroundings = emissivity_[i];
        const scalar qRadIncident = emissivitySurroundings*sigma*pow4(Tinf_[i]);
        const scalar qRadAbsorbed = + absorptivity  *qRadIncident;
        const scalar qRadEmission = - emissivity_[i]*sigma*pow4(T);
        const scalar qRad = 
            + qRadAbsorbed 
            + qRadEmission;
        const scalar qTotal = qRad + qConv;

        this->refValue()[i] = Tinf_[i];  // not used
        this->refGrad()[i] = qTotal;
        this->valueFraction()[i] = 0.0;
    }

    mixedFvPatchField<scalar>::updateCoeffs();
}
I am not able to understand this: How Temperature is getting modified by these three lines of code, what is the relation between updated temperature and these lines?

Code:
        this->refValue()[i] = Tinf_[i];  // not used
        this->refGrad()[i] = qTotal;
        this->valueFraction()[i] = 0.0;
Thanks
Saeng Kinley likes this.
mehtab is offline   Reply With Quote

Old   April 28, 2015, 12:32
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
The gradient of the temperature field at the boundary is set to the heat flux. OpenFOAM uses this heat flux to determine the temperature in the simulation (it is not set to a fixed value.)
jherb is offline   Reply With Quote

Old   April 28, 2015, 12:44
Default
  #3
Member
 
Mehtab
Join Date: Jan 2015
Posts: 41
Rep Power: 11
mehtab is on a distinguished road
Quote:
Originally Posted by jherb View Post
The gradient of the temperature field at the boundary is set to the heat flux. OpenFOAM uses this heat flux to determine the temperature in the simulation (it is not set to a fixed value.)
Thanks Jaochim for your response.

However, I did not understand well.

Are you saying that grad(T)/dz = qRad in this case?

What will happen if I use valueFraction = 1?

I am trying to implement a boundary condition with given function:

T_s = T_0 + 1/Cp(Qr/phi - Hv)

I can get all the values (constant and field variables) at the patch. How should I update the temperature in the code?

Thanks
mehtab is offline   Reply With Quote

Old   April 28, 2015, 12:57
Default
  #4
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
Quote:
Originally Posted by firefoam View Post
Thanks Jaochim for your response.

However, I did not understand well.

Are you saying that grad(T)/dz = qRad in this case?

What will happen if I use valueFraction = 1?

I am trying to implement a boundary condition with given function:

T_s = T_0 + 1/Cp(Qr/phi - Hv)

I can get all the values (constant and field variables) at the patch. How should I update the temperature in the code?

Thanks
If valueFraction is 1, then the field will take on the value refValue*valueFaction + (1-valueFraction)*refGrad =refValue. So you'd effectively have a fixedValue BC, which in this case is set to Tinf
Kummi and fizsics like this.
mturcios777 is offline   Reply With Quote

Old   April 28, 2015, 13:25
Default
  #5
Member
 
Mehtab
Join Date: Jan 2015
Posts: 41
Rep Power: 11
mehtab is on a distinguished road
Quote:
Originally Posted by mturcios777 View Post
If valueFraction is 1, then the field will take on the value refValue*valueFaction + (1-valueFraction)*refGrad =refValue. So you'd effectively have a fixedValue BC, which in this case is set to Tinf
Hi Marco,

Thanks for a nice explanation. But as in the code valueFarction = 0 then

Value = refGrad (qRad) as shown in the code...... is this grad(T)/dz?

if I use valueFraction =1 then

Value = refValue (Tref) as shown in the code.....is this T?

Does it change the value also based on valueFraction? for valueFraction =0 it calculates temperature gradient and for valueFraction =1, it calculates fix temperature value?
Kummi likes this.
mehtab is offline   Reply With Quote

Old   April 28, 2015, 14:09
Default
  #6
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
I guess your code is from fireFoam.

As you can see at https://github.com/fireFoam-dev/fire...larField.H#L53 the class
constHTemperatureRadiationFvPatchScalarField is derived from the mixedFvPatchField class. The value at the boundary is calculated then at https://github.com/OpenFOAM/OpenFOAM...chField.C#L168 where you can see the effect of the valueFraction variable. So if it's 0 only the gradient is considered, if it's 1 only the value (and interpolated for values in between).
Kummi likes this.
jherb is offline   Reply With Quote

Old   April 28, 2015, 14:11
Default
  #7
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
If you look at the code, you will see that the superclass method updateCoeffs is called (for mixedFvPatchField). If you look at the code there, you can see how the BCs are applied. I've found the best way to implement BCs is to write it out mathematically and see what you need to set your gradient and value references to get what you want.
mturcios777 is offline   Reply With Quote

Old   April 29, 2015, 05:44
Default
  #8
Member
 
Mehtab
Join Date: Jan 2015
Posts: 41
Rep Power: 11
mehtab is on a distinguished road
Hi Marco and Joachim,

Thank you very much for a nice explanation. I am very new to OpenFOAM and try to modify BC for my case.

It clears many doubts that I had. I will try to implement and come back soon if there is any update.

Also, if there is any thread that can help me regarding implementing new BC please share.

Thanks in advance..
mehtab is offline   Reply With Quote


Old   April 30, 2015, 06:17
Default
  #10
Member
 
Mehtab
Join Date: Jan 2015
Posts: 41
Rep Power: 11
mehtab is on a distinguished road
Hi,

Thanks Joachim for your references.

I tried to implement my boundary condition and successfully compiled it as well but while running the solver I am getting errors.

I think there is something wrong with Cp, the way it is being accessed from the solver. But I am not sure what to do. I tried many things playing with this terms looking at other boundary conditions but could not get away of it. Please help.

Code:
void Foam::customHTemperatureFvPatchScalarField::updateCoeffs()
{

    if (this->updated())
    {
        return;
    }

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

    const basicThermo& thermo =
        db().lookupObject<basicThermo>("thermophysicalProperties");

    const fvsPatchField<scalar>& phip =
        patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);

    const fvsPatchField<scalar>& Qrp =
        patch().lookupPatchField<surfaceScalarField, scalar>(QrName_);

//    const scalarField alphap =
//        turbulence.alphaEff()().boundaryField()[patchI];

//     const fvmesh& mesh = patch().boundaryMesh().mesh();

     const scalarField Cp_ = thermo.Cp();
//        thermo.Cp().boundaryField()[patchI];
//          mesh.lookupObject<volScalarField>(thermo.cp());

    scalar T0=300;
    scalar Hv=8500;


    refValue() = Tinf_;
    refGrad() = 0.0;
    valueFraction() =
        1.0 + 1.0/(T0*Cp_)*((Qrp/phip)-Hv);
        //1.0/(1.0 + K_/max(h_,SMALL)*patch().deltaCoeffs());

    mixedFvPatchField<scalar>::updateCoeffs();
}
The error message is below:

Quote:
Starting time loop

Courant Number mean: 0 max: 0
deltaT = 0.00119904
Time = 0.00119904

diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 1.45716e-08, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 1.46251e-08, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 4.04326e-11, No Iterations 2
epsilonTotal min/ave/max = 2.23276e-05 8.10636e-05 0.000258387
mStar min/ave/max = 2.13222 3.93224 7.25477
Dcof_ = 2.46584
Gamma min/ave/max = 0.429178 0.457961 0.485101
Chi min/ave/max = 1.81202e-05 1.81202e-05 1.81202e-05
Cedc min/ave/max = 7.77695e-06 8.29851e-06 8.7903e-06
TauDiff min/ave/max = 0.0283528 0.465313 2.78597
TauEDC min/ave/max = 17724.2 32543.7 53353.6
Cmod min/ave/max = 0.000688331 0.010115 0.0536895
TauReaction min/ave/max = 12.2285 393.019 2867.17
RR(CH4) min/ave/max = -8.50645e-08 -9.06231e-09 -3.62674e-10
RR(O2) min/ave/max = -3.39337e-07 -3.61512e-08 -1.44677e-09
RR(CO2) min/ave/max = 9.94918e-10 2.48605e-08 2.33356e-07
RR(H2O) min/ave/max = 8.1453e-10 2.03531e-08 1.91047e-07
kTotal min/ave/max = 0.000424276 0.000973583 0.00217071
TauMix min/ave/max = 1.0761 1.88548 2.9853
DILUPBiCG: Solving for O2, Initial residual = 0.999795, Final residual = 2.83217e-05, No Iterations 1
DILUPBiCG: Solving for H2O, Initial residual = 1, Final residual = 4.10954e-05, No Iterations 1
DILUPBiCG: Solving for CH4, Initial residual = 1, Final residual = 2.83283e-05, No Iterations 1
DILUPBiCG: Solving for CO2, Initial residual = 1, Final residual = 4.10954e-05, No Iterations 1
DILUPBiCG: Solving for H2, Initial residual = 0, Final residual = 0, No Iterations 0
O2 min/ave/max = 0.232469 0.233008 0.23301
H2O min/ave/max = 9.39287e-13 2.34615e-11 2.1889e-10
CH4 min/ave/max = 9.99909e-07 7.63223e-06 0.00232315
CO2 min/ave/max = 1.1473e-12 2.86573e-11 2.67366e-10
N2 min/ave/max = 0.765208 0.766984 0.766989
H2 min/ave/max = 0 0 0


--> FOAM FATAL ERROR:

request for surfaceScalarField from objectRegistry region0 failed
available objects of type surfaceScalarField are

5
(
ghf
convectiveHeatFlux_T
multivariateWeights
phi
convectiveHeatFlux_L
)


From function objectRegistry::lookupObject<Type>(const word&) const
in file /home/maqsood/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 164.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const& Foam:bjectRegistry::lookupObject<Foam::Geometric Field<double, Foam::fvsPatchField, Foam::surfaceMesh> >(Foam::word const&) const at ??:?
#3 at customHTemperatureFvPatchScalarField.C:?
#4 Foam::customHTemperatureFvPatchScalarField::update Coeffs() at ??:?
#5 Foam::mixedFvPatchField<double>::evaluate(Foam::UP stream::commsTypes) at ??:?
#6 Foam::mixedEnergyFvPatchScalarField::updateCoeffs( ) at ??:?
#7 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::updateCoef fs() at ??:?
#8 Foam::fvMatrix<double>::fvMatrix(Foam::GeometricFi eld<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) at ??:?
#9 Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::Sp<double>(Foam:imensionedField<doubl e, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#10 Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::Sp<double>(Foam::tmp<Foam::GeometricFie ld<double, Foam::fvPatchField, Foam::volMesh> > const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#11 Foam::radiation::radiationModel::Sh(Foam::fluidThe rmo&) const at ??:?
#12
at ??:?
#13 __libc_start_main in "/lib64/libc.so.6"
#14
at /home/abuild/rpmbuild/BUILD/glibc-2.19/csu/../sysdeps/x86_64/start.S:125
Aborted
The error comes when it tries to calculates RTE from radiation model. I compare the log file with another case.
Please suggest what should I do?

Thanks in advance....
Kummi likes this.
mehtab is offline   Reply With Quote

Old   April 30, 2015, 12:21
Default
  #11
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
Using the code search feature of github in the OpenFOAM/OpenFOAM-2.3.x repository I found the following code at
https://github.com/OpenFOAM/OpenFOAM...arField.C#L256
Code:
        Qr = patch().lookupPatchField<volScalarField, scalar>(QrName_);
Qr is a volume scalar field (and not a surface scalar field), i.e. it is defined in the cell centers not on the faces between cells.
Where is your Qrp defined, cell of face?
jherb is offline   Reply With Quote

Old   April 30, 2015, 12:48
Default
  #12
Member
 
Mehtab
Join Date: Jan 2015
Posts: 41
Rep Power: 11
mehtab is on a distinguished road
Quote:
Originally Posted by jherb View Post
Code:
        Qr = patch().lookupPatchField<volScalarField, scalar>(QrName_);
Qr is a volume scalar field (and not a surface scalar field), i.e. it is defined in the cell centers not on the faces between cells.
I tried it and change it to volScalarField and compiled it. But I am getting the same error when running the tutorial (smallpoolfire2D). I am not sure if I modified Qr correct or not.

Code:
void Foam::customHTemperatureFvPatchScalarField::updateCoeffs()
{

    if (this->updated())
    {
        return;
    }

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

    const basicThermo& thermo =
        db().lookupObject<basicThermo>("thermophysicalProperties");

    const fvsPatchField<scalar>& phip =
        patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);

    const fvPatchField<scalar>& Qrp =
        patch().lookupPatchField<volScalarField, scalar>(QrName_);

//    const scalarField alphap =
//        turbulence.alphaEff()().boundaryField()[patchI];

//     const fvmesh& mesh = patch().boundaryMesh().mesh();

     const scalarField Cp_ = thermo.Cp();
//        thermo.Cp().boundaryField()[patchI];
//          mesh.lookupObject<volScalarField>(thermo.cp());

    scalar T0=300;
    scalar Hv=8500;


    refValue() = Tinf_;
    refGrad() = 0.0;
    valueFraction() =
        1.0 + 1.0/(T0*Cp_)*((Qrp/phip)-Hv);
        //1.0/(1.0 + K_/max(h_,SMALL)*patch().deltaCoeffs());

    mixedFvPatchField<scalar>::updateCoeffs();
}
Quote:
Originally Posted by jherb View Post
Where is your Qrp defined, cell of face?
I want Qrp to update my inlet temperature. So i think it should be defined at the patch (face). Will there be any issue if I take near cell centred value of Qr and update my temperature? I am not experienced in this.

Looking at the errors is it also possible that he problem also comes from phip not from Qr?


Thanks
mehtab is offline   Reply With Quote

Old   April 30, 2015, 19:46
Default
  #13
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
Quote:
Code:
From function objectRegistry::lookupObject<Type>(const word&) const
    in file /home/maqsood/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 164.
What is in line 164?
jherb is offline   Reply With Quote

Old   May 1, 2015, 06:12
Thumbs up
  #14
Member
 
Mehtab
Join Date: Jan 2015
Posts: 41
Rep Power: 11
mehtab is on a distinguished road
Hi Joachim,
I am sorry for editing the post many times. But I have done something and posting the current status.
I have attached my files for your reference. Just want to tell you that what I have done actually. I have taken another boundary condition which was working to update temperature and modify that. The error is similar but it is looking for volScalarField now, not surfaceScalarField as before.
Since I am new I may do some silly mistakes and here we discuss on a different track. It is a great help from you. Please share if you found the problem and I will try to modify that part.



objectRegistryTemplates.C

customEnthalpyFluxTemperatureFvPatchScalarField.C

customEnthalpyFluxTemperatureFvPatchScalarField.H
Code:
template<class Type>
const Type& Foam::objectRegistry::lookupObject(const word& name) const
{
    const_iterator iter = find(name);

    if (iter != end())
    {
        const Type* vpsiPtr_ = dynamic_cast<const Type*>(iter());

        if (vpsiPtr_)
        {
            return *vpsiPtr_;
        }

        FatalErrorIn
        (
            "objectRegistry::lookupObject<Type>(const word&) const"
        )   << nl
            << "    lookup of " << name << " from objectRegistry "
            << this->name()
            << " successful\n    but it is not a " << Type::typeName
            << ", it is a " << iter()->type()
            << abort(FatalError);
    }
    else
    {
        if (this->parentNotTime())
        {
            return parent_.lookupObject<Type>(name);
        }

        FatalErrorIn
        (
            "objectRegistry::lookupObject<Type>(const word&) const"
        )   << nl                   //line 164
            << "    request for " << Type::typeName
            << " " << name << " from objectRegistry " << this->name()
            << " failed\n    available objects of type " << Type::typeName
            << " are" << nl
            << names<Type>()
            << abort(FatalError);
    }

    return *reinterpret_cast< const Type* >(0);
}
164,1 98%

The error looks like:

Quote:
--> FOAM FATAL ERROR:

request for volScalarField none from objectRegistry region0 failed
available objects of type volScalarField are

70
(
(((4*Rp)*pow3(T))|Cpv)
thermo:mu
TauMix
cp
thermosi
mixfraction
(0*CH4)
WsOxidLamC3H8
Cedc
h
C3H8
Kappa
WsOxidLamCH4
CO2
TauDiff
Yfsi
kSGS
H2
O2_0
WsOxidC3H8
WsFormCH4
fv
Tsoot
CH4_0
WsTotalCH4
wFuel
p
T
WsTotalC3H8
p_0
alphaSgs
YfsCH4
H2O
epsilonSGS
((Rp*pow3(T))*(T-((4*h)|Cpv)))
H2O_0
mStar
N2
Gamma
Cmod
kTotal
CO2_0
((ddt(p)+convection(phiU,p))-(div(phiU)*p))
Cpv
TauReaction
refSpecie
kappa
rho
WsOxidCH4
epsilonTotal
k
C3H8_0
O2
p_rgh
YfsC3H8
WsFormC3H8
H2_0
gh
delta
CH4
thermosi_0
dQ
rho_0
TauEDC
pow3(T)
dEff
Chi
muSgs
thermo:alpha
dQsoot
)


From function objectRegistry::lookupObject<Type>(const word&) const
in file /home/maqsood/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 164.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const& Foam:bjectRegistry::lookupObject<Foam::Geometric Field<double, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const at ??:?
#3 Foam::customEnthalpyFluxTemperatureFvPatchScalarFi eld::updateCoeffs() at ??:?
#4 Foam::mixedFvPatchField<double>::evaluate(Foam::UP stream::commsTypes) at ??:?
#5 Foam::mixedEnergyFvPatchScalarField::updateCoeffs( ) at ??:?
#6 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::updateCoef fs() at ??:?
#7 Foam::fvMatrix<double>::fvMatrix(Foam::GeometricFi eld<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) at ??:?
#8 Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::Sp<double>(Foam:imensionedField<doubl e, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#9 Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::Sp<double>(Foam::tmp<Foam::GeometricFie ld<double, Foam::fvPatchField, Foam::volMesh> > const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#10 Foam::radiation::radiationModel::Sh(Foam::fluidThe rmo&) const at ??:?
#11
at ??:?
#12 __libc_start_main in "/lib64/libc.so.6"
#13
at /home/abuild/rpmbuild/BUILD/glibc-2.19/csu/../sysdeps/x86_64/start.S:125
Aborted
In available volScalarField 'Qr' is not available. So I think I need to find a way to calculate Qr from available options. Any idea how Qr is being calculated. Am I thinking towards solution?

Thanks in advance

Last edited by mehtab; May 1, 2015 at 07:43.
mehtab is offline   Reply With Quote

Old   May 1, 2015, 12:26
Default
  #15
Member
 
Mehtab
Join Date: Jan 2015
Posts: 41
Rep Power: 11
mehtab is on a distinguished road
Hi,

any body knows how radField is being declared here?

https://github.com/fireFoam-dev/fire...arField.C#L225

In this boundary condition implementation radiative heat flux is being accessed on a boundary patch. I am trying to do the same but getting errors.

Also in the current implementation nbrPatch.lookupObjectField has been used. I am using patch.lookupObjectField instead because in my case there is only one region and no interface.

Quote:
customEnthalpyFluxTemperatureFvPatchScalarField/customEnthalpyFluxTemperatureFvPatchScalarField.C: In member function ‘virtual void Foam::customEnthalpyFluxTemperatureFvPatchScalarFi eld::updateCoeffs()’:
customEnthalpyFluxTemperatureFvPatchScalarField/customEnthalpyFluxTemperatureFvPatchScalarField.C: 187:9: error: ‘radField’ was not declared in this scope
radField =
^
customEnthalpyFluxTemperatureFvPatchScalarField/customEnthalpyFluxTemperatureFvPatchScalarField.C: 188:18: error: ‘((Foam::customEnthalpyFluxTemperatureFvPatchScala rField*)this)->Foam::fvPatchField<Type>:atch<double>’ does not have class type
patch.lookupPatchField<volScalarField, scalar>
^
customEnthalpyFluxTemperatureFvPatchScalarField/customEnthalpyFluxTemperatureFvPatchScalarField.C: 188:50: error: expected primary-expression before ‘,’ token
patch.lookupPatchField<volScalarField, scalar>
^
customEnthalpyFluxTemperatureFvPatchScalarField/customEnthalpyFluxTemperatureFvPatchScalarField.C: 188:58: error: expected primary-expression before ‘>’ token
patch.lookupPatchField<volScalarField, scalar>
^
customEnthalpyFluxTemperatureFvPatchScalarField/customEnthalpyFluxTemperatureFvPatchScalarField.C: 194:6: error: ‘mpp’ was not declared in this scope
mpp.distribute(radField);
^
customEnthalpyFluxTemperatureFvPatchScalarField/customEnthalpyFluxTemperatureFvPatchScalarField.C: 211:30: error: ‘((Foam::customEnthalpyFluxTemperatureFvPatchScala rField*)this)->Foam::fvPatchField<Type>:atch<double>’ does not have class type
scalarList radField(patch.size(),0.0);
^
customEnthalpyFluxTemperatureFvPatchScalarField/customEnthalpyFluxTemperatureFvPatchScalarField.de p:603: recipe for target 'Make/linux64GccDPOpt/customEnthalpyFluxTemperatureFvPatchScalarField.o' failed
make: *** [Make/linux64GccDPOpt/customEnthalpyFluxTemperatureFvPatchScalarField.o] Error 1
Any help....

Thanks in advance
mehtab is offline   Reply With Quote

Old   May 1, 2015, 12:41
Default
  #16
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

See line 219.

And I guess your next question will be about mpp, its definition is on line 179.
alexeym is offline   Reply With Quote

Old   May 1, 2015, 12:51
Default
  #17
Member
 
Mehtab
Join Date: Jan 2015
Posts: 41
Rep Power: 11
mehtab is on a distinguished road
Hi,

I tried to mdify my boundary condition and compiled it. I have edited "fixedEnthalpyFluxTemperatureFvPatchScalarFiel d" and also taken some part of the code from "turbulentTemperatureRadiationQinCoupledMixed" for accessing radiation flux Qr.
Code:
void Foam::customEnthalpyFluxTemperatureFvPatchScalarField::updateCoeffs()
{

    if (this->updated())
    {
        return;
    }

    const label patchI = patch().index();
    const basicThermo& thermo =
        db().lookupObject<basicThermo>("thermophysicalProperties");
    
    const scalarField Cp_ = thermo.Cp();

    const fvsPatchField<scalar>& phip =
        patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
//add radiation part to read Qr



    scalarList radField(patch().size(),0.0);


        radField =
            patch().lookupPatchField<volScalarField, scalar>
            (
                FieldRadiativeName_
            );

    
 //    mpp().distribute(radField);
    const fvMesh& mesh = patch().boundaryMesh().mesh();
            
            const radiation::radiationModel& radiation =
                mesh.lookupObject<radiation::radiationModel>
                (
                    "radiationProperties"
                );

            scalarField temissivity
            (
                radiation.absorptionEmission().e()().boundaryField()
                [
                    //nbrPatch.index()
                    patch().index()
                ]
            );
    
            
    scalar Qr = gSum(radField*patch().magSf());


    const compressible::LESModel& turbulence =
        db().lookupObject<compressible::LESModel>
        (
            "LESProperties"
        );

    const scalarField alphap =
        turbulence.alphaEff()().boundaryField()[patchI];

 

    scalar T0=300;
    scalar Hv=8500;

    refValue() = Tinf_;
    refGrad() = 0.0;
    valueFraction() =
          1.0 + 1.0/(T0*Cp_)*((Qr/phip)-Hv);

//Info << valueFraction() << endl;
//Info << refValue() << endl;
//    }
    mixedFvPatchField<scalar>::updateCoeffs();
}

While running tutorial it show following errors:

Quote:
--> FOAM FATAL ERROR:

request for volScalarField Qr from objectRegistry region0 failed
available objects of type volScalarField are

70
(
(((4*Rp)*pow3(T))|Cpv)
thermo:mu
TauMix
cp
thermosi
mixfraction
(0*CH4)
WsOxidLamC3H8
Cedc
h
C3H8
Kappa
WsOxidLamCH4
CO2
TauDiff
Yfsi
kSGS
H2
O2_0
WsOxidC3H8
WsFormCH4
fv
Tsoot
CH4_0
WsTotalCH4
wFuel
p
T
WsTotalC3H8
p_0
alphaSgs
YfsCH4
H2O
epsilonSGS
((Rp*pow3(T))*(T-((4*h)|Cpv)))
H2O_0
mStar
N2
Gamma
Cmod
kTotal
CO2_0
((ddt(p)+convection(phiU,p))-(div(phiU)*p))
Cpv
TauReaction
refSpecie
kappa
rho
WsOxidCH4
epsilonTotal
k
C3H8_0
O2
p_rgh
YfsC3H8
WsFormC3H8
H2_0
gh
delta
CH4
thermosi_0
dQ
rho_0
TauEDC
pow3(T)
dEff
Chi
muSgs
thermo:alpha
dQsoot
)


From function objectRegistry::lookupObject<Type>(const word&) const
in file /home/maqsood/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 164.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const& Foam:bjectRegistry::lookupObject<Foam::Geometric Field<double, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const at ??:?
#3 Foam::customEnthalpyFluxTemperatureFvPatchScalarFi eld::updateCoeffs() at ??:?
#4 Foam::mixedFvPatchField<double>::evaluate(Foam::UP stream::commsTypes) at ??:?
#5 Foam::mixedEnergyFvPatchScalarField::updateCoeffs( ) at ??:?
#6 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::updateCoef fs() at ??:?
#7 Foam::fvMatrix<double>::fvMatrix(Foam::GeometricFi eld<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) at ??:?
#8 Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::Sp<double>(Foam:imensionedField<doubl e, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#9 Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::Sp<double>(Foam::tmp<Foam::GeometricFie ld<double, Foam::fvPatchField, Foam::volMesh> > const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#10 Foam::radiation::radiationModel::Sh(Foam::fluidThe rmo&) const at ??:?
#11
at ??:?
#12 __libc_start_main in "/lib64/libc.so.6"
#13
at /home/abuild/rpmbuild/BUILD/glibc-2.19/csu/../sysdeps/x86_64/start.S:125
Aborted

Please help....

Thanks

Last edited by mehtab; May 5, 2015 at 10:00.
mehtab is offline   Reply With Quote

Old   May 5, 2015, 09:50
Default
  #18
Member
 
Mehtab
Join Date: Jan 2015
Posts: 41
Rep Power: 11
mehtab is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

See line 219.

And I guess your next question will be about mpp, its definition is on line 179.

I am trying to access Qr at my boundary patch for calculating temperature.

Can you please tell me what is radField here and how it is calculating Qr?
mehtab 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
CGNS Boundary conditions using SU2 denzell SU2 3 July 9, 2018 05:58
several fields modified by single boundary condition schröder OpenFOAM Programming & Development 3 April 21, 2015 05:09
Overflow Error in Multiphase Modelling with Two Continuous Fluids ashtonJ CFX 6 August 11, 2014 14:32
Radiation interface hinca CFX 15 January 26, 2014 17:11
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44


All times are GMT -4. The time now is 07:57.