⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hscclt.cpp

📁 是一个结构试验设计的加工曲线的跟踪实现 没有密码。第一次
💻 CPP
📖 第 1 页 / 共 5 页
字号:
// SARCSLT.cpp : Defines the entry point for the console application.


                     //*****钢筋混凝土矩形截面力学性能分析程序*****//
#include "stdafx.h"
#include "iostream.h"
#include "fstream.h"
#include "iomanip.h"
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "conio.h"
#define pi 3.1415926
#define Ste_Bol 5.669*1E-8       //辐射中斯蒂芬-波尔兹曼常数

double Sectwid,Sectlen;          //截面尺寸
int Sect_Type;                   //截面类型
double Prot_thick;               //保护层厚度
double Spall_thick;              //爆裂厚度 
double Critical_T;               //爆裂临界温度

int TDimension;                  //温度场是进行三维温度场还是二维温度场分析
int Fire0,Fire1,Fire2,Fire3;     //受火面情况
int Step;                        //温度场分析的时间步数目
long TNode_num;                  //温度场分析时节点总数目
long TConElem_num;               //温度场分析时混凝土单元总数目
long *TCElemNode_Info;           //温度场分析时混凝土每个单元对应的节点号
double *Node_Coor;               //温度场节点坐标
double *TimeHis;                 //存储温度场分析的时间步的信息

int Env_heatType;                //升温曲线的选择  国际or美国
int Water_Method;                //温度场分析时混凝土是否考虑水分的影响,0-不考虑,1-Lie方法,2-欧洲规范EC2方法 
double CWaterContent;            //温度场分析考虑水分影响,混凝土含水的质量百分数  
double Qw;                       //水的蒸发能
double Cw;                       //水的质量热容
double PWater;                   //混凝土的质量密度
double CWaterPeakT;              //按欧洲规范EC2考虑混凝土含水影响时,对应的峰值温度
double PConcrete;                //混凝土的质量密度
double iniT0;                    //初始温度T0
  
int TempAnalysis;                //控制是否进行温度场分析,0-不分析,1-分析
int MeshID;                      //结构分析的网格划分是否和温度场分析一样,1-一样,0-不一样

int VarTstep;                    //控制温度场分析是否采用变步长技术
double DelTemp=0.0;              //变时间步时每一时间步温度增量

int F2Longbar_num;               //纵筋的数目
double *F2LbarInfo;              //纵筋单元信息,节点坐标(*2)+钢筋类型,总共[F2Longbar_num,3]个元素
int Longbar_num;                 //纵筋的数目

int div1,div2;                   //截面网格划分数,按约定输入x向,y向
int Tdiv1,Tdiv2;                 //温度场单元划分
int divProt;                     //保护层划分层数

long F2Node_num;                 //力简化分析时节点总数目
long F2ConElem_num;              //力简化分析时混凝土单元总数目
long *F2CElemNode_Info;          //力简化分析时混凝土每个单元对应的节点号
double *F2Node_Coor;             //力简化分析的截面网格划分时的节点坐标
  
int F2method;                    //计算方法的选取,1-Lie,2-韩林海
int StructID;                    //是否要进行结构分析
 
//简化分析时的函数和公共变量
int Csresta;                     //混凝土本构关系取值的建议公式,1-过镇海建议,2-Lie建议公式   
int Ssresta;                     //钢筋本构关系取值的建议公式,1-过镇海建议,2-Lie建议公式   

double ceutt;                    //混凝土高温极限拉应变
double ceptt;                    //混凝土高温受拉峰值应变
double ccstress;                 //混凝土高温受压峰值应力
double ctstress;                 //混凝土高温受拉峰值应力
double fc;                       //混凝土棱柱体抗压强度
double cp;                       //混凝土常温峰值应变
double cpt;                      //混凝土高温峰值应变
double E0tt;                     //混凝土的高温受拉弹性模量

double sfyt;                     //钢筋的高温屈服强度
double seyt;                     //钢筋的屈服应变
double sfu;                      //钢筋的极限抗拉强度
int sgaowenx;                    //是否考虑钢筋的高温徐变
double Wendubu;                  //温度补偿时间(小时)
double WendubuDT;                //温度补偿时间对温度的导数

double Ecst(int,double,double,double,double);
double Ectempt(int,double,double,double,double);
double Ectimet(int,double,double,double,double);
double Esst(int,double,double,double,double,double,double);           
double Estempt(int,double,double,double,double,double,double);             
double Estimet(int,double,double,double,double,double,double); 

double CStress(int,double,double); //根据混凝土的应力应变和温度求应力; 
//根据钢筋的应力应变和温度求应力;
double SStress(int,double,double,double,double);  
   
//计算钢筋的应力应变增量;
double SStstrainZ(int,double,double,double,double,double,double,double,double,double);           
//计算混凝土的应力应变增量;
double CStstrainZ(int,double,double,double,double,double,double,double);       

void matinvert(double *,long);                         //矩阵求逆
void matmpl(double *,long,long,double *,long,double*); //矩阵相乘                       
int agaus(double [],double [],int);                    //矩阵相除

#include "TempF2D.h"
#include "TempF3D.h"
#include "Struct2D.h"

int main(int argc, char* argv[])
{
	int i;

	ifstream Input("Input.txt");
	char NoUse[200];//为输入设置的无用的变量
    //***从文件Input.txt读取初始数据***
	if(Input.fail())
	{
		cerr<<"error opening the Input.txt!\n";
		exit(0);
	}
	Input.getline(NoUse,sizeof(NoUse));  
	Input>>Sectwid>>Sectlen;
	Input.getline(NoUse,sizeof(NoUse));  
	Input>>Prot_thick;
	Input.getline(NoUse,sizeof(NoUse));  
	Input>>Spall_thick;
	Input.getline(NoUse,sizeof(NoUse));  
	Input>>MeshID;
	Input.getline(NoUse,sizeof(NoUse));  
	Input>>div1>>div2;
	Input.getline(NoUse,sizeof(NoUse));
	Input>>Tdiv1>>Tdiv2;
	Input.getline(NoUse,sizeof(NoUse));
	Input>>divProt;
	Input.getline(NoUse,sizeof(NoUse));
	Input>>iniT0;
	Input.getline(NoUse,sizeof(NoUse));
	Input>>Critical_T;
	Input.getline(NoUse,sizeof(NoUse));
	Input>>Step;
	Input.getline(NoUse,sizeof(NoUse));
	Input>>VarTstep;
	Input.getline(NoUse,sizeof(NoUse));
	Input>>DelTemp;
	Input.getline(NoUse,sizeof(NoUse));
	Input>>Env_heatType;
	Input.getline(NoUse,sizeof(NoUse));
	Input>>TempAnalysis;
	Input.getline(NoUse,sizeof(NoUse));
	Input>>StructID;
	Input.getline(NoUse,sizeof(NoUse));
	Input>>TDimension;

	if(Sectwid>0.0 && Sectlen>0.0) //矩形截面
	{
		Sect_Type=1;
	}
	else
	{
		cout<<"截面边长输入有错! "<<" Sectwid= "<<Sectwid<<", Sectlen= "<<Sectlen<<endl;
		exit(0);
	}

	//下面利用有限单元法计算温度场
	if(TempAnalysis==1)
	{
		if(TDimension==2)
			TempF2D(); 
		if(TDimension==3)
			TempF3D(); 
	}
	else 
	{
		ifstream TimeIn("TimeHistory.txt");
		TimeHis=(double *)calloc(Step,8);
		for(i=0; i<Step; i++)
			TimeIn>>*(TimeHis+i);
	}
	if(StructID==1)   //进行结构分析
	{
		Struct2D();    //LIE和韩林海的简化方法进行结构计算
	}

	return 0;
}
//Hstress的值,见过书P204式(12-5),isub表示采用的建议公式类别,Estress表示有效应力,Estrain表示有效应变
double Ecst(int isub,double Estress,double Estrain,double T,double time0)  
{
   double N;
   double Hstress;       //临时变量,见过镇海书p204,式12-5
   double Ntemp;         //临时变量

   if(isub==1)   //按过镇海建议
   {
	    ccstress=fc/(1.0+18.0*pow(T/1000,5.1));   //混凝土高温受压峰值应力,过P23,式(2-3);
        ctstress=0.0-ccstress*0.1;    //混凝土的高温受拉峰值应力;
        cpt=cp*(1.0+5.0*pow(T/1000,1.7));   //混凝土高温峰值应力所对应的应变;
        E0tt=ccstress/cpt*2.2;     //过镇海的书,p25式(2-9);
        ceptt=ctstress/E0tt;         //混凝土的受拉峰值应变;

		if(Estrain<=ceutt)   //混凝土拉裂;
			N=0.0;
        if(Estrain>=ceutt && Estrain<=ceptt)
		{
			N=0.0-ctstress/(ceutt-ceptt);
			//N=0.0;
			if(fabs(ceutt-ceptt)<0.00003)
			{
				N=0.0;
			}
		}
        if(Estrain>=ceptt && Estrain<=0.0)
			N=E0tt;
        if(Estrain>=0.0 && Estrain<=cpt)    //混凝土受压
		{
			Hstress=1.0/(1.0+ccstress*(2.2/cpt-2.8*Estrain/cpt/cpt+0.6*Estrain*Estrain/cpt/cpt/cpt)*((72.0*T*T/1000/1000.0-T/1000.0)/1000.0/fc+60.0*sqrt(time0/60.0/120.0)*(exp(6.0*T/1000.0)-1.0)/ccstress/1000000.0));
		    N=ccstress*(2.2/cpt-2.8*Estrain/cpt/cpt+0.6*Estrain*Estrain/cpt/cpt/cpt)*Hstress;
		}
        if(Estrain>=cpt)   
		{
			Ntemp=ccstress*((0.8*(Estrain/cpt-1.0)*(Estrain/cpt-1.0)+Estrain/cpt)/cpt-Estrain/cpt*(1.6*(Estrain/cpt-1.0)/cpt+1.0/cpt))/((0.8*(Estrain/cpt-1.0)*(Estrain/cpt-1.0)+Estrain/cpt)*(0.8*(Estrain/cpt-1.0)*(Estrain/cpt-1.0)+Estrain/cpt));			
			Hstress=1.0/(1.0+Ntemp*((72.0*T*T/1000/1000.0-T/1000.0)/1000.0/fc+60.0*sqrt(time0/60.0/120.0)*(exp(6.0*T/1000.0)-1.0)/ccstress/1000000.0));		
			N=Ntemp*Hstress;
		}
   }
   if(isub==2)   //按Lie建议公式;
   {
	    if(T<=450.0)
	       ccstress=fc;
        else if(T>=450.0  && T<=874.0)
           ccstress=fc*(2.011-2.353*(T-20.0)/1000.0);
        else if(T>=874.0)
           ccstress=0.0;
        
		if(T<874.0)
		{
            ctstress=0.0-ccstress*0.1;    //混凝土的高温受拉峰值应力;
            cpt=0.0025+(6.0*T+0.04*T*T)/1000000.0;   //混凝土高温峰值应力所对应的应变;
            E0tt=ccstress/cpt*2.0;     //过镇海的书,p25式(2-9),原点切线模量;			
	        ceptt=ctstress/E0tt;         //混凝土的受拉峰值应变;
		
		    if(Estrain<=ceutt)   //混凝土拉裂;
		    	N=0.0;
            if(Estrain>=ceutt && Estrain<=ceptt)
			{
			    N=0.0-ctstress/(ceutt-ceptt);
			    if(fabs(ceutt-ceptt)<0.00003)
				   N=0.0;
			}
            if(Estrain>=ceptt && Estrain<=0.0)
			   N=E0tt;
            if(Estrain>=0 && Estrain<=cpt)    //混凝土受压
			{
			    Hstress=1.0;
			    N=ccstress*(-2.0)*(cpt-Estrain)*(-1.0)/cpt/cpt;
			}
            if(Estrain>=cpt)   
			{
			   Hstress=1.0;
		   	   N=ccstress*2.0/9.0/cpt/cpt*(cpt-Estrain)*Hstress;
			}
		}
		if(T>=874.0)
			N=0.0;
   } 
   if(isub==3)   //按Kodur建议HSC公式
   {
	    if(T<20.0)
		{
			ccstress=fc;
		}
		if(T>=20.0 && T<100.0)
		{
			ccstress=fc*(1.0-0.003125*(T-20.0));
		}
		if(T>=100.0 && T<400.0)
		{
			ccstress=0.75*fc;
		}
		if(T>=400 && T<=917.24)
		{
			ccstress=fc*(1.33-0.00145*T);
		}
		if(T>917.24)
		{
			ccstress=0.0;
		}

		if(T<917.24)
		{
			Ntemp=2.28-0.012*fc/1000000.0;

			ctstress=0.0-ccstress*0.1;    //混凝土的高温受拉峰值应力
			//混凝土高温峰值应力所对应的应变
			cpt=0.0018+(6.7*fc/1000000.0+6*T+0.03*T*T)/1000000.0;
			//过镇海的书,p25式(2-9),原点切线模量
			E0tt=ccstress/cpt*(2.28-0.012*fc/1000000.0); 			
			ceptt=ctstress/E0tt;         //混凝土的受拉峰值应变

			if(Estrain<ceutt)   //混凝土拉裂
			{
		    	N=0.0;
			}
            if(Estrain>=ceutt && Estrain<ceptt)
			{
			    N=0.0-ctstress/(ceutt-ceptt);
			    if(fabs(ceutt-ceptt)<0.00003)
				   N=0.0;
			}
            if(Estrain>=ceptt && Estrain<0.0)
			{
				N=E0tt;
			}
            if(Estrain>=0 && Estrain<=cpt)    //混凝土受压
			{
			    Hstress=1.0;
			    N=Hstress*ccstress*(-Ntemp)*pow((cpt-Estrain)/cpt,Ntemp-1.0)*(-1.0)/cpt;
			}
            if(Estrain>cpt)   
			{
			   Hstress=1.0;
		   	   N=Hstress*(-1.0)*ccstress*2.0*30.0*30.0*(Estrain-cpt)/cpt/cpt/(130.0-fc/1000000.0)/(130.0-fc/1000000.0);
			}
		}
		else if(T>=917.24)
		{
			N=0.0;
		}
   }
   return(N);
}
//混凝土的温度切线模量的值,见过镇海的书P204页,式(12-4),isub表示采用的建议公式类别,Estress表示有效
//应力,Estrain表示有效应变,T表示温度,time0表示时间
double  Ectempt(int isub,double Estress,double Estrain,double T,double time0)              
{
   double N;
   double Hstress;       //临时变量,见过镇海书p204,式12-5
   double fsdives;   
   double fsdivt;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -