|
[Sponsors] | |||||
Coded heat source unrelistic tempearture increase |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Farouk
Join Date: Jul 2020
Posts: 11
Rep Power: 7 ![]() |
Hello Foamers,
I am having issues implementing a linearly increasing coded source in a trapezoidally shaped cell zone. The overall heat release of the linearly increasing heat source is the same as a uniform one that I implemented with a semiImplicidSource (I only used the explicit term), but the temperature always gets out of range. In both cases I am using the same mesh, and cellzone geometery. My goal in the linearly increasing coded source is to have an incrementaly increasing heat source in the x-direction that is constant in the y-direction. To do this, I am using a simple function of q = a*x +b. Where q is the volume specific heat release (thermal power - [W/m^3]), with a and b be being constants determined such that the total heat release is always the same at 110 W. Code:
energySource2
{
type scalarCodedSource;
active yes;
name sourceTime;
scalarCodedSourceCoeffs
{
selectionMode cellZone;
cellZone heatSourceZone;
fields (h);
codeInclude
#{
#};
codeCorrect
#{
Pout<< "**codeCorrect**" << endl;
#};
codeAddSup
#{
const Time& time = mesh().time();
const vectorField& C = mesh_.C();
const scalarField& V = mesh_.V();
scalarField& heSource = eqn.source();
const volVectorField& U = mesh().lookupObject<volVectorField>("U");
const volScalarField cellx = U.mesh().C() & vector(1,0,0);
const scalar a = 344947657.2909107;
const scalar b = 80630728.52883253;
//heSource -= 110;
forAll(V, i)
{
heSource[i] -= (a*cellx[i] + b)*V[i];
}
#};
codeSetValue
#{
#};
// not sure if below code needed
code
#{
$codeInclude
$codeCorrect
$codeAddSup
$codeSetValue
#};
}
sourceTimeCoeffs
{
$scalarCodedSourceCoeffs;
}
}
The error: Code:
--> FOAM Warning :
From function Foam::scalar Foam::janafThermo<EquationOfState>::limit(Foam::scalar) const [with EquationOfState = Foam::perfectGas<Foam::specie>; Foam::scalar = double]
in file /import/usr_local/share/OpenFOAM/OpenFOAM-7/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 117
attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 6000; T = 6952.79
--> FOAM Warning :
From function Foam::scalar Foam::janafThermo<EquationOfState>::limit(Foam::scalar) const [with EquationOfState = Foam::perfectGas<Foam::specie>; Foam::scalar = double]
in file /import/usr_local/share/OpenFOAM/OpenFOAM-7/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 117
attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 6000; T = 7029.23
--> FOAM Warning :
From function Foam::scalar Foam::janafThermo<EquationOfState>::limit(Foam::scalar) const [with EquationOfState = Foam::perfectGas<Foam::specie>; Foam::scalar = double]
in file /import/usr_local/share/OpenFOAM/OpenFOAM-7/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 117
attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 6000; T = 7071.1
--> FOAM Warning :
From function Foam::scalar Foam::janafThermo<EquationOfState>::limit(Foam::scalar) const [with EquationOfState = Foam::perfectGas<Foam::specie>; Foam::scalar = double]
in file /import/usr_local/share/OpenFOAM/OpenFOAM-7/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 117
attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 6000; T = 7078.56
--> FOAM Warning :
From function Foam::scalar Foam::janafThermo<EquationOfState>::limit(Foam::scalar) const [with EquationOfState = Foam::perfectGas<Foam::specie>; Foam::scalar = double]
in file /import/usr_local/share/OpenFOAM/OpenFOAM-7/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 117
attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 6000; T = 7046.39
--> FOAM Warning :
From function Foam::scalar Foam::janafThermo<EquationOfState>::limit(Foam::scalar) const [with EquationOfState = Foam::perfectGas<Foam::specie>; Foam::scalar = double]
in file /import/usr_local/share/OpenFOAM/OpenFOAM-7/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 117
attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 6000; T = 6951.62
Code:
import numpy as np
import matplotlib.pyplot as plt
H = 0.0254
z_th = 0.001
R1 = 0.003175
R2 = 0.00740833
L = H*4.06
Q = 110.0 #variable
alpha = ((R2-R1)/3 + R1/2)*L**2
beta = ((R2-R1)/2 + R1)*L
A_trapezoid = ((2*R1)+(2*R2))*L/2
Volume = A_trapezoid*0.001
q = Q/Volume
b = 0.9*q ##variable
a = ((Q/(2*z_th))-b*beta)/alpha
xRange = np.linspace(0,L, num = 20)
y_increase = xRange*a + b
plt.plot(xRange,y_increase)
plt.xlabel('mm')
plt.ylabel('W/m^3')
Farouk |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| polynomial BC | srv537 | OpenFOAM Pre-Processing | 4 | December 3, 2016 10:07 |
| [foam-extend.org] problem when installing foam-extend-1.6 | Thomas pan | OpenFOAM Installation | 7 | September 9, 2015 22:53 |
| [swak4Foam] Swak4FOAM 0.2.3 / OF2.2.x installation error | FerdiFuchs | OpenFOAM Community Contributions | 27 | April 16, 2014 16:14 |
| centOS 5.6 : paraFoam not working | yossi | OpenFOAM Installation | 2 | October 9, 2013 02:41 |
| How can I increase Heat Transfer at Domain Interf? | B.Simon | CFX | 3 | October 28, 2008 19:53 |