double Lattice2d_mt :: givePressure() { LatticeTransportMaterialStatus *status; IntegrationRule *iRule = this->giveDefaultIntegrationRulePtr(); GaussPoint *gp = iRule->getIntegrationPoint(0); status = static_cast< LatticeTransportMaterialStatus * >( gp->giveMaterialStatus() ); return status->givePressure(); }
double Lattice2d_mt :: givePressure() { LatticeTransportMaterialStatus *status; GaussPoint *gp; IntegrationRule *iRule = integrationRulesArray [ giveDefaultIntegrationRule() ]; gp = iRule->getIntegrationPoint(0); Material *mat = this->giveMaterial(); status = ( LatticeTransportMaterialStatus * ) mat->giveStatus(gp); return status->givePressure(); }
double Lattice2d_mt :: giveMass() { LatticeTransportMaterialStatus *status; IntegrationRule *iRule = this->giveDefaultIntegrationRulePtr(); GaussPoint *gp = iRule->getIntegrationPoint(0); status = static_cast< LatticeTransportMaterialStatus * >( gp->giveMaterialStatus() ); double mass = 0; mass = status->giveMass(); //multiply with volume mass *= this->length * this->width / 2.; return mass; }
double Lattice2d_mt :: giveMass() { LatticeTransportMaterialStatus *status; GaussPoint *gp; IntegrationRule *iRule = integrationRulesArray [ giveDefaultIntegrationRule() ]; gp = iRule->getIntegrationPoint(0); Material *mat = this->giveMaterial(); status = ( LatticeTransportMaterialStatus * ) mat->giveStatus(gp); double mass = 0; mass = status->giveMass(); //multiply with volume mass *= this->length * this->width / 2.; return mass; }
double LatticeTransportMaterial :: giveCharacteristicValue(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) { LatticeTransportMaterialStatus *status = static_cast< LatticeTransportMaterialStatus * >( this->giveStatus(gp) ); double suction = status->giveTempField().at(1); if ( mode == Capacity ) { return computeCapacity(suction, gp); } else if ( mode == Conductivity ) { return computeConductivity(suction, gp, tStep); } else { OOFEM_ERROR("unknown mode"); } return 0; // to make compiler happy }
double LatticeTransportMaterial :: computeConductivity(double suction, GaussPoint *gp, TimeStep *tStep) { LatticeTransportMaterialStatus *status = static_cast< LatticeTransportMaterialStatus * >( this->giveStatus(gp) ); matMode = gp->giveMaterialMode(); this->density = this->give('d', gp); double relativePermeability = 0.; double conductivity = 0.; double saturation, partOne, partTwo, numerator, denominator; if ( suction < this->suctionAirEntry || conType == 0 ) { saturation = 1.; relativePermeability = 1.; } else { partOne = pow( suction / this->paramA, 1. / ( 1. - this->paramM ) ); saturation = ( this->thetaM - this->thetaR ) / ( this->thetaS - this->thetaR ) * pow(1. + partOne, -this->paramM); partTwo = ( this->thetaS - this->thetaR ) / ( this->thetaM - this->thetaR ); numerator = ( 1. - pow(1. - pow(partTwo * saturation, 1 / this->paramM), this->paramM) ); denominator = ( 1. - pow(1. - pow(partTwo, 1 / this->paramM), this->paramM) ); relativePermeability = sqrt(saturation) * pow( ( numerator ) / ( denominator ), 2.0 ); } //Calculate mass for postprocessing double mass = ( saturation * ( this->thetaS - this->thetaR ) + this->thetaR ) * this->density; status->setMass(mass); conductivity = this->permeability / this->viscosity * relativePermeability; //add crack contribution; //Read in crack lengths FloatArray crackLengths; static_cast< LatticeTransportElement * >( gp->giveElement())->giveCrackLengths(crackLengths); FloatArray crackWidths; crackWidths.resize(crackLengths.giveSize()); #ifdef __SM_MODULE IntArray coupledModels; if ( domain->giveEngngModel()->giveMasterEngngModel() ) { (static_cast< StaggeredProblem *>(domain->giveEngngModel()->giveMasterEngngModel()))->giveCoupledModels(coupledModels); int couplingFlag = ( static_cast< LatticeTransportElement * >( gp->giveElement() ) )->giveCouplingFlag(); if ( couplingFlag == 1 && coupledModels.at(1) != 0 && !tStep->isTheFirstStep() ) { IntArray couplingNumbers; static_cast< LatticeTransportElement * >( gp->giveElement())->giveCouplingNumbers(couplingNumbers); for (int i = 1; i <= crackLengths.giveSize(); i++) { if ( couplingNumbers.at(i) != 0 ) { crackWidths.at(i) = static_cast< LatticeStructuralElement* >( domain->giveEngngModel()->giveMasterEngngModel()->giveSlaveProblem( coupledModels.at(1) )->giveDomain(1)->giveElement(couplingNumbers.at(i)))->giveCrackWidth(); } else { crackWidths.at(i) = 0.; } } } } #endif //Read in crack widths from transport element if (!domain->giveEngngModel()->giveMasterEngngModel()){ static_cast< LatticeTransportElement * >( gp->giveElement() )->giveCrackWidths(crackWidths); } //Use crack width and apply cubic law double crackContribution = 0.; for(int i = 1; i <=crackLengths.giveSize();i++){ if(crackWidths.at(i)<this->crackLimit || this->crackLimit < 0.){ crackContribution += pow(crackWidths.at(i), 3.) / crackLengths.at(i) ; } else { printf("Limit is activated\n"); crackContribution += pow(crackLimit, 3.) / crackLengths.at(i) ; } } crackContribution *= this->crackTortuosity * relativePermeability/ (12. * this->viscosity ); conductivity += crackContribution; return this->density * conductivity; }