本文整理汇总了C++中TransportMaterialStatus::giveTempField方法的典型用法代码示例。如果您正苦于以下问题:C++ TransportMaterialStatus::giveTempField方法的具体用法?C++ TransportMaterialStatus::giveTempField怎么用?C++ TransportMaterialStatus::giveTempField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransportMaterialStatus
的用法示例。
在下文中一共展示了TransportMaterialStatus::giveTempField方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeCapacityCoeff
double HeMoKunzelMaterial :: computeCapacityCoeff(MatResponseMode mode, GaussPoint *gp, TimeStep *atTime)
{
// if (gp->giveElement()->giveNumber() == 4)
// double bzzz = 20;
if ( mode == Capacity_ww ) {
TransportMaterialStatus *status = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
FloatArray s;
double h;
double dw_dh;
// s = status->giveTempStateVector();
s = status->giveTempField();
if ( s.isEmpty() ) {
OOFEM_ERROR("computeCapacityCoeff: undefined state vector");
}
h = s.at(2);
dw_dh = this->sorptionIsothermDerivative(h);
return dw_dh;
// CONSTANT
//return 10.;
} else if ( mode == Capacity_wh ) {
return 0.0;
} else if ( mode == Capacity_hw ) {
return 0.0;
} else if ( mode == Capacity_hh ) {
TransportMaterialStatus *status = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
FloatArray s;
double h, w;
double dHs_dT, dHw_dT;
//s = status->giveTempStateVector();
s = status->giveTempField();
if ( s.isEmpty() ) {
OOFEM_ERROR("computeCapacityCoeff: undefined state vector");
}
h = s.at(2);
w = this->sorptionIsotherm(h);
dHs_dT = cs * give('d', NULL);
dHw_dT = cw * w;
return ( dHs_dT + dHw_dT );
// CONSTANT return 1.7e6;
} else {
OOFEM_ERROR("Unknown MatResponseMode");
}
return 0.0; // to make compiler happy
}
示例2: if
void
HeMoKunzelMaterial :: matcond1d(FloatMatrix &d, GaussPoint *gp, MatResponseMode mode, TimeStep *atTime)
{
double k = 0.0, h = 0.0, t = 0.0;
TransportMaterialStatus *status = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
FloatArray s;
// s = status->giveTempStateVector();
s = status->giveTempField();
if ( s.isEmpty() ) {
OOFEM_ERROR("matcond1d: undefined state vector");
}
h = s.at(2);
t = s.at(1);
if ( mode == Conductivity_ww ) {
k = perm_mm(h, t);
} else if ( mode == Conductivity_wh ) {
k = perm_mh(h, t);
} else if ( mode == Conductivity_hw ) {
k = perm_hm(h, t);
} else if ( mode == Conductivity_hh ) {
k = perm_hh(h, t);
} else {
OOFEM_ERROR("Unknown MatResponseMode");
}
d.resize(1, 1);
d.at(1, 1) = k;
}
示例3: get_b
double HeMoTKMaterial :: computeCapacityCoeff(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
{
if ( mode == Capacity_ww ) {
return 1.0 * rho;
} else if ( mode == Capacity_wh ) {
return 0.0;
} else if ( mode == Capacity_hw ) {
TransportMaterialStatus *status = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
FloatArray s;
double w, t;
s = status->giveTempField();
if ( s.isEmpty() ) {
OOFEM_ERROR("undefined state vector");
}
w = s.at(2);
t = s.at(1);
return get_b(w, t) * get_latent(w, t);
} else if ( mode == Capacity_hh ) {
TransportMaterialStatus *status = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
FloatArray s;
double w, t;
s = status->giveTempField();
if ( s.isEmpty() ) {
OOFEM_ERROR("undefined state vector");
}
w = s.at(2);
t = s.at(1);
return get_ceff(w, t);
} else {
OOFEM_ERROR("Unknown MatResponseMode");
}
return 0.0; // to make compiler happy
}
示例4: if
void
HeMoTKMaterial :: matcond3d(FloatMatrix &d, GaussPoint *gp, MatResponseMode mode, TimeStep *tStep)
// function creates conductivity matrix of the
// isotropic heat material for 3D problems
//
// d - conductivity matrix of the material
// 25.9.2001
{
double k = 0.0, w = 0.0, t = 0.0;
TransportMaterialStatus *status = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
FloatArray s;
// w = Tm->ip[ipp].av[0];
// t = Tm->ip[ipp].av[1];
s = status->giveTempField();
if ( s.isEmpty() ) {
OOFEM_ERROR("undefined state vector");
}
w = s.at(2);
t = s.at(1);
if ( mode == Conductivity_ww ) {
k = perm_ww(w, t);
} else if ( mode == Conductivity_wh ) {
k = perm_wt(w, t);
} else if ( mode == Conductivity_hw ) {
k = perm_ww(w, t) * get_latent(w, t);
} else if ( mode == Conductivity_hh ) {
k = get_chi(w, t) + get_latent(w, t) * perm_wt(w, t);
} else {
OOFEM_ERROR("Unknown MatResponseMode");
}
d.resize(3, 3);
d.at(1, 1) = k;
d.at(1, 2) = 0.0;
d.at(1, 3) = 0.0;
d.at(2, 1) = 0.0;
d.at(2, 2) = k;
d.at(2, 3) = 0.0;
d.at(3, 1) = 0.0;
d.at(3, 2) = 0.0;
d.at(3, 3) = k;
}
示例5: inverse_sorption_isotherm
double
HeMoTKMaterial :: giveHumidity(GaussPoint *gp, ValueModeType mode)
{
TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
const FloatArray &tempState = ms->giveTempField();
if ( tempState.giveSize() < 2 ) {
OOFEM_ERROR("undefined moisture status!");
}
FloatArray state = ms->giveField();
if ( mode == VM_Total ) {
return inverse_sorption_isotherm( tempState.at(2) );
} else if ( mode == VM_Incremental ) {
return inverse_sorption_isotherm( tempState.at(2) ) - inverse_sorption_isotherm( state.at(2) );
} else if ( mode == VM_Velocity ) { // VM_Previous
return inverse_sorption_isotherm( state.at(2) );
}
return 1.;
}
示例6: giveFluxVector
void
HeMoKunzelMaterial :: giveFluxVector(FloatArray &answer, GaussPoint *gp, const FloatArray &grad, const FloatArray &field, TimeStep *tStep)
{
TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
FloatArray s;
// s = ms->giveTempStateVector();
s = ms->giveTempField();
if ( s.isEmpty() ) {
OOFEM_ERROR("matcond1d: undefined state vector");
}
double h = s.at(2);
double t = s.at(1);
FloatArray ans_w, ans_t;
FloatArray grad_w, grad_t;
int size = grad.giveSize() / 2;
for ( int i = 1; i <= size; ++i ) {
grad_w.at(i) = grad.at(i);
}
for ( int i = size + 1; i <= size * 2; ++i ) {
grad_t.at(i) = grad.at(i);
}
ans_w.beScaled(perm_mm(h, t), grad_w);
ans_w.beScaled(perm_mh(h, t), grad_t);
ans_t.beScaled(perm_hm(h, t), grad_w);
ans_t.beScaled(perm_hh(h, t), grad_t);
answer.resize(size * 2);
answer.zero();
answer.addSubVector(ans_w, 1);
answer.addSubVector(ans_t, size + 1);
ms->setTempField(field);
ms->setTempGradient(grad);
ms->setTempFlux(answer);
}
示例7: giveHumidity
double
HeMoKunzelMaterial :: giveHumidity(GaussPoint *gp, ValueModeType mode)
{
TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
const FloatArray &tempState = ms->giveTempField();
if ( tempState.giveSize() < 2 ) {
OOFEM_ERROR("Undefined moisture status");
}
const FloatArray &state = ms->giveField();
if ( mode == VM_Total ) {
return tempState.at(2);
} else if ( mode == VM_Incremental ) {
return tempState.at(2) - state.at(2);
} else if ( mode == VM_Velocity ) { // VM_Previous
return state.at(2);
} else {
OOFEM_ERROR("Undefined moisture mode");
}
return 1.;
}