double HydratingIsoHeatMaterial :: giveCharacteristicValue(MatResponseMode rmode, GaussPoint *gp, TimeStep *tStep) { double answer = 0; FloatArray vec; if ( rmode == Capacity ) { if ( castAt && ( tStep->giveTargetTime() < castAt ) ) { answer = this->give('c', gp, tStep) * this->give('d', gp, tStep) / 1000; // Zero capacity before cast } else { answer = this->give('c', gp, tStep) * this->give('d', gp, tStep); } } else if ( !hydrationLHS ) { answer = 0; } else if ( hydrationModel ) { //!!! better via HydrationModelInterface vec = static_cast< TransportMaterialStatus * >( giveStatus(gp) )->giveTempField(); if ( vec.giveSize() < 2 ) { vec.resize(2); vec.at(2) = 1.; // saturated if undefined } answer = hydrationModel->giveCharacteristicValue(vec, rmode, gp, tStep) / tStep->giveTimeIncrement(); } else { OOFEM_ERROR("unknown MatResponseMode (%s)", __MatResponseModeToString(rmode) ); } return answer; }
double HydratingHeMoMaterial :: giveCharacteristicValue(MatResponseMode rmode, GaussPoint *gp, TimeStep *tStep) { double answer = 0; if ( ( rmode >= Capacity_ww ) && ( rmode <= Capacity_wh ) ) { // standard HeMoTK values answer = HeMoTKMaterial :: giveCharacteristicValue(rmode, gp, tStep); if ( castAt && ( tStep->giveTargetTime() < castAt ) ) { answer *= PRECAST_CAPACITY_COEFF; // ~Zero capacity before cast } } else if ( ( rmode >= IntSource_ww ) && ( rmode <= IntSource_wh ) ) { // Internal source values if ( !hydrationLHS ) { answer = 0; } else if ( hydrationModel ) { //!!! better via HydrationModelInterface FloatArray vec = static_cast< TransportMaterialStatus * >( giveStatus(gp) )->giveTempField(); if ( vec.giveSize() < 2 ) { vec.resize(2); vec.at(2) = 1.0; // saturated if undefined } else { vec.at(2) = inverse_sorption_isotherm( vec.at(2) ); // compute relative humidity } answer = hydrationModel->giveCharacteristicValue(vec, rmode, gp, tStep) / tStep->giveTimeIncrement(); if ( ( rmode == IntSource_ww ) || ( rmode == IntSource_hw ) ) { answer *= give_dphi_dw( vec.at(2) ); } } } else { OOFEM_ERROR("unknown MatResponseMode (%s)", __MatResponseModeToString(rmode) ); } return answer; }
double HeMoTKMaterial :: giveHumidity(GaussPoint *gp, ValueModeType mode) { FloatArray tempState = ( ( TransportMaterialStatus * ) giveStatus(gp) )->giveTempStateVector(); if ( tempState.giveSize() < 2 ) { _error("giveHumidity: undefined moisture status!"); } FloatArray state = ( ( TransportMaterialStatus * ) giveStatus(gp) )->giveStateVector(); 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.; }
double HydrationModel :: giveHydrationDegree(GaussPoint *gp, TimeStep *tStep, ValueModeType mode) // returns the hydration degree in integration point gp { HydrationModelStatus *status = static_cast< HydrationModelStatus * >( giveStatus(gp) ); double ksi = status->giveTempHydrationDegree(); if ( mode == VM_Incremental ) { ksi -= status->giveHydrationDegree(); } return ksi; }
void HydratingHeMoMaterial :: updateInternalState(const FloatArray &vec, GaussPoint *gp, TimeStep *tStep) { TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) ); FloatArray aux; if ( ms ) { ms->letTempStateVectorBe(vec); if ( hydration ) { /* OBSOLETE * FloatArray s = ms->giveStateVector (); * if (vec.isEmpty()) OOFEM_ERROR("empty new state vector"); * aux.resize(2); * aux.at(1) = vec.at(1); * if (s.isEmpty()||(tStep->giveTime()<=0)) aux.at(2) = initialHydrationDegree; // apply initial conditions * else { * aux.at(2) = s.at(2); * if (!castAt || (tStep->giveTime()>=castAt)) aux.at(2) += hydrationModel->dksi (s.at(2), vec.at(1), tStep->giveTimeIncrement()); // compute hydration degree increment * } */ // it is necessary to convert the passed state vector to relative humidity expected by the hydration model //!!! might be cleaner to choose wc / h in hydration model, but it must be defined which one is passed anyway; so relative humidity was chosen //!!! also, the humidity vector might be evaluated by a function (ensure 2 elements and set humidity) FloatArray vech = vec; if ( vech.giveSize() >= 2 ) { vech.at(2) = inverse_sorption_isotherm( vec.at(2) ); // compute relative humidity } else { vech.resize(2); vech.at(2) = 1.; // saturated if undefined } HydrationModelInterface :: updateInternalState(vech, gp, tStep); // additional file output !!! if ( teplotaOut && ( gp->giveNumber() == 1 ) && giveStatus(gp) ) { FILE *vyst = fopen("teplota.out", "a"); computeInternalSourceVector(aux, gp, tStep, VM_Incremental); if ( aux.isEmpty() ) { aux.resize(1); aux.zero(); } aux.times( 1. / give('d', gp) ); fprintf( vyst, "Elem %.3d krok %.2d: t= %.0f, dt=%.0f, %ld. it, ksi= %.12f, T= %.8f, heat=%.8f\n", gp->giveElement()->giveNumber(), tStep->giveNumber(), tStep->giveTargetTime(), tStep->giveTimeIncrement(), tStep->giveSolutionStateCounter(), giveHydrationDegree(gp, tStep, VM_Total), vec.at(1), aux.at(1) * tStep->giveTimeIncrement() ); fclose(vyst); } } } }
void HydratingIsoHeatMaterial :: updateInternalState(const FloatArray &vec, GaussPoint *gp, TimeStep *tStep) { TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) ); FloatArray aux; if ( ms ) { ms->letTempStateVectorBe(vec); if ( hydration ) { /* OBSOLETE * FloatArray s = ms->giveStateVector (); * if (vec.isEmpty()) OOFEM_ERROR("empty new state vector"); * aux.resize(2); * aux.at(1) = vec.at(1); * if (s.isEmpty()||(tStep->giveTime()<=0)) aux.at(2) = initialHydrationDegree; // apply initial conditions * else { * aux.at(2) = s.at(2); * if (!castAt || (tStep->giveTime()>=castAt)) aux.at(2) += hydrationModel->dksi (s.at(2), vec.at(1), tStep->giveTimeIncrement()); // compute hydration degree increment * } */ HydrationModelInterface :: updateInternalState(vec, gp, tStep); // additional file output !!! if ( ( gp->giveNumber() == 1 ) && giveStatus(gp) ) { FILE *vyst = fopen("teplota.out", "a"); computeInternalSourceVector(aux, gp, tStep, VM_Incremental); if ( aux.isEmpty() ) { aux.resize(1); aux.zero(); } aux.times( 1. / give('d', gp, tStep) ); fprintf( vyst, "Elem %.3d krok %.2d: t= %.0f, dt=%.0f, %ld. it, ksi= %.12f, T= %.8f, heat=%.8f\n", gp->giveElement()->giveNumber(), tStep->giveNumber(), tStep->giveTargetTime(), tStep->giveTimeIncrement(), tStep->giveSolutionStateCounter(), giveHydrationDegree(gp, tStep, VM_Total), vec.at(1), aux.at(1) * tStep->giveTimeIncrement() ); fclose(vyst); } } } }
void HydrationModel :: updateInternalState(const FloatArray &vec, GaussPoint *gp, TimeStep *tStep) /* * Recalculates the hydration degree according to the given new state vector and time increment, using equilib status * State vector is supposed to contain [1]->temperature, [2]->relative humidity! * caller should ensure that this is called only when state vector is changed */ { double ksi, dksi, T = 0., h = 1.; // get hydration model status associated with integration point HydrationModelStatus *status = static_cast< HydrationModelStatus * >( giveStatus(gp) ); if ( vec.giveSize() ) { T = vec(0); if ( vec.giveSize() > 1 ) { h = vec(1); } else { h = 1; // assume saturated if undefined } } else { OOFEM_ERROR("undefined state vector."); } ksi = status->giveHydrationDegree(); if ( !ksi && initialHydrationDegree ) { ksi = initialHydrationDegree; status->setHydrationDegree(ksi); } // !!! timeScale if ( tStep->giveTimeIncrement() > 0. ) { dksi = computeHydrationDegreeIncrement(ksi, T, h, tStep->giveTimeIncrement() * timeScale); } else { dksi = 0.; } status->setTempHydrationDegree(ksi + dksi); }