示例#1
0
void
NonlinearFluidMaterial :: giveDeviatoricStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp,
                                                        TimeStep *tStep)
{
    FloatArray eps;
    double normeps2;

    NonlinearFluidMaterialStatus *status = static_cast< NonlinearFluidMaterialStatus * >( this->giveStatus(gp) );
    eps = status->giveTempDeviatoricStrainVector();
    normeps2 = status->giveTempStrainNorm2();

    answer.resize( eps.giveSize(), eps.giveSize() );
    answer.zero();
    for ( int i = 1; i <= answer.giveNumberOfRows(); i++ ) {
        answer.at(i, i) = 1.;
    }
    if ( eps.giveSize() == 3 ) {
        answer.at(3, 3) *= 0.5;
    } else if ( eps.giveSize() == 4 ) {
        answer.at(4, 4) *= 0.5;
    } else {
        answer.at(4, 4) *= 0.5;
        answer.at(5, 5) *= 0.5;
        answer.at(6, 6) *= 0.5;
    }

    if ( normeps2 != 0 ) {
        FloatMatrix op;
        if ( eps.giveSize() == 3 ) {
            eps.at(3) *= 0.5;
        } else if ( eps.giveSize() == 4 ) {
            eps.at(4) *= 0.5;
        } else {
            eps.at(4) *= 0.5;
            eps.at(5) *= 0.5;
            eps.at(6) *= 0.5;
        }
        op.beDyadicProductOf(eps, eps);
        answer.times( 2 * viscosity * ( 1 + c * pow(normeps2, alpha * 0.5) ) );
        answer.add(2 * viscosity * c * alpha * pow(normeps2, alpha * 0.5 - 1), op);
    } else {
        answer.times(2 * viscosity);
    }
}
void
NonlinearFluidMaterial :: giveDeviatoricStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp,
                                                        TimeStep *atTime)
{
    FloatArray eps;
    double normeps = 0;

    FloatMatrix op, t2;

    NonlinearFluidMaterialStatus *status = static_cast< NonlinearFluidMaterialStatus * >( this->giveStatus(gp) );
    eps = status->giveTempDeviatoricStrainVector();

    eps.at(3) *= 0.5;

    normeps = eps.at(1) * eps.at(1) + eps.at(2) * eps.at(2) + 2 * ( eps.at(3) * eps.at(3) );
    normeps = sqrt(normeps);

    op.resize(3, 3);
    op.beDyadicProductOf(eps, eps);
    if ( normeps != 0 ) {
        op.times( 2 * viscosity * c * alpha * pow(normeps, alpha - 2) );
    } else {
        op.times(0);
    }

    t2.resize(3, 3);
    t2.zero();
    for ( int i = 1; i <= 3; i++ ) {
        if ( normeps != 0 ) {
            t2.at(i, i) = 2 * viscosity * ( 1 + c * pow(normeps, alpha) );
        } else {
            t2.at(i, i) = 2 * viscosity;
        }
    }

    t2.at(3, 3) *= 0.5;

    answer.resize(3, 3);
    answer.zero();
    answer.add(op);
    answer.add(t2);
}