晶粒长大fortran程序
蒙特卡洛模拟正常晶粒长大的实时-温度模型

蒙特卡洛模拟正常晶粒长大的实时-温度模型JINHUA GAO and R. G . THOMPSON摘要两种不同的模型,在金属和合金中模拟晶粒正常生长被提出来了。
这些模型的实际应用证明了时间-温度基于蒙特卡洛(MC )模拟材料加工。
一个变形晶界迁移模型加上蒙特卡洛(MC)模拟耦合的第一原则变形晶界迁移模型。
这个模拟的结果显示与在等温条件下晶粒生长的正常长大部分实验结果相关联。
基于模型的实验数据加上蒙特卡洛(MC)模拟晶粒生长的实验数据。
模拟的实验结果显示与钛合金在持续加热的条件下晶粒生长相关联。
1.介绍晶粒尺寸大小可以说是材料最重要的微观特性。
它影响着材料的强度、脆性、韧性、耐腐蚀性、耐热性以及其他性质。
由于它的重要性,晶粒生长在大多材料科学工程研究中成为一个关键科学问题。
Beck 等人[l]提出了等温条件下晶粒生长动力学关系式:nt C D 1= (1)式中:D 是晶粒尺寸半径,1C 是一个系统常数,t 表示时间,n 是动力学时间指数。
后来Burke 和Turnbull [2]推导出等温晶粒生长抛物线关系式:t RT Q C D D ⎪⎭⎫ ⎝⎛-=-exp 2202 (2)式中:0D 是t=0时刻时初始晶粒尺寸半径,2C 是一个系统常数,Q 是晶粒生长活化能,R 是气体常数,T 表示温度。
有许多关于各种金属和合金等温晶粒生长模拟的文献报道。
大多数实验结果表明时间指数n 的理论值在0.5左右[3-7]。
一些实验表明温度和时间指数n 有一定的关系[8-l1]。
Anderson 等人[12]提出了用计算机模拟技术观察晶粒生长,这种方法被叫成为蒙特卡洛(MC )模拟。
在很多关于蒙特卡洛(MC)模拟晶粒生长的出版文献中,模拟晶粒生长动力学被作为真实晶粒生长的动力学,但是在真实时间-温度和模拟时间当中,向前的相关联性的重要性已经被认可。
Ling and Anderson [13]指出蒙特卡洛模拟时间转换到真实时间需要一种隐含的活化能的因素⎥⎦⎤⎢⎣⎡⎪⎭⎫ ⎝⎛-RT W exp ,和原子的跳跃频率相对应。
热处理过程中材料晶粒长大行为的数值模拟与优化设计

热处理过程中材料晶粒长大行为的数值模拟与优化设计热处理是材料科学中一项重要的工艺,通过控制材料的加热、保温和冷却过程,可以调控材料的晶粒尺寸和分布,从而改变材料的性能和微观结构。
而材料晶粒长大行为是热处理过程中的重要现象之一,对材料的性能和结构起着关键的影响。
为了更好地理解晶粒长大行为,并对热处理工艺进行优化设计,数值模拟成为了一种重要的研究手段。
数值模拟在材料科学中的应用已经得到了广泛的发展,通过建立数学模型和物理方程,可以模拟材料在热处理过程中的晶粒长大行为。
这种方法能够通过考虑各种影响因素,如温度、时间、本体浓度等,准确地预测晶粒尺寸的变化和晶粒分布的演化。
在实际应用中,数值模拟可以辅助实验研究,提供有效的预测结果,优化热处理工艺。
在进行数值模拟研究时,第一步是建立适当的数学模型。
晶粒长大行为一般通过两种方法进行模拟:离散模型和连续模型。
离散模型通常基于孤立晶粒的长大机制,将晶粒视为个体,通过计算每个晶粒周围的溶质浓度梯度和位错密度来推导晶粒长大的速率。
连续模型则更加侧重于描述晶粒演化的宏观行为,通过偏微分方程描述晶粒数密度分布函数的演化。
在建立数学模型后,数值模拟需要考虑多种影响晶粒长大的因素。
首先是温度,温度是控制晶粒长大速率的主要因素之一,高温可以加速晶粒生长。
其次是溶质浓度,溶质原子的扩散对晶粒生长起到重要的作用,溶质浓度和晶粒尺寸之间存在着复杂的关系。
此外,晶粒间的位错密度也会影响晶粒长大的速率,位错相互作用会引起晶界迁移,进而影响晶粒的长大行为。
对这些因素进行数值模拟的优化设计是研究的重点之一。
通过改变材料的加热速率、保温时间和冷却速率等热处理工艺参数,可以实现对晶粒长大行为的控制。
数值模拟可以帮助设计出最佳的热处理工艺,以在给定的加工条件下获得具有理想性能和微观结构的材料。
然而,数值模拟也面临一些挑战和限制。
首先是模型的准确性,由于晶粒长大行为的复杂性,提出一个完全准确的数学模型仍然存在一定的困难。
凝固相变晶粒形核长大的数值模拟

摘要本文主要是把遗传算法(简称GA方法)的基本原理和基本思想用于到材料科学中模拟液态金属凝固结晶过程中的晶粒形核并长大,并且模拟了晶粒形核过程中的无规则运动模型。
在此基础上,通过使用VB 编程语言编程实现了用GA方法进行组织结构模拟。
文中详细地介绍了凝固相变原理,揭示了晶粒形核和长大的热力学和动力学。
在具体模拟过程中,本算法基于最小能量原理和晶粒形核长大的动力学这两个基本原则进行模拟的,简单介绍了GA方法及其发展历程以及VB编程模拟系统,详细叙述了GA模拟方法,以及在二维坐标中用200X200个方形晶格点元素模拟晶粒形核并长大的过程和晶粒无规则运动的模型。
模拟结果揭示了GA方法在模拟微观组织过程中的重要作用,该算例也说明了GA方法在模拟晶粒长大过程方面的直观性和有效性,并且简介GA方法在材料加工中其他应用。
最后,对晶粒长大的GA模拟进行总结。
并归纳总结所用模拟算法的优缺点。
在此基础上对所作课题做出展望。
关键词:遗传算法;凝固;晶粒形核;晶粒长大;模拟ABSTRACTThis article mainly is the genetic algorithm (the i.e. GA method) of the basic principle and the basic thought use in the materials science in the simulation liquid metal coagulation crystallization process crystal grain shape nucleus and grow up, and has simulated in the crystal grain shape nuclear process non-regular movement model . In this foundation, through used the VB programming language programming to realize has carried on the organizational structure simulation with the GA method.In the article introduced in detail the principle of the coagulation changes, has promulgated the crystal grain shape nucleus and coarsening thermodynamics and dynamics. In the concrete simulation process, this algorithm carries on the simulation based on the smallest energy principle and crystal grain shape nucleus coarsening dynamics these two basic principles, introduced simply the GA method and the development course as well as the vb programming analogous system, narrated the GA simulation method in detail, as well as in the two-dimensional coordinates the process and the crystal grain non-regular movement model which and grows up with the 200x200 square shape lattice point element simulation crystal grain shape nucleus. The analogue result has promulgated the GA method in the simulation microscopic organization process vital role, this example also showed the GA method in the simulation microscopic organization process vital role, this example also showed the GA method in simulation crystal growth process aspect intuitive and the validity, and introduces the GA method in the material processing other applications.Finally, carries on the summary to the crystal growth GA simulation. And induces summarizes uses the simulation algorithm the good and bad points. To makes the topic in this foundation to make the forecast.Key words: Genetic algorithm; coagulation; Grain nucleation; Grain growth; simulation目录摘要 (I)ABSTRACT (II)目录 (III)第一章绪论 (1)第一节晶粒长大的一般概述 (1)第二节课题主要内容 (2)第二章凝固相变原理 (3)第一节均匀形核 (3)第二节形核率 (5)第三节非均匀形核 (6)第四节晶核长大 (8)第五节扩散机制 (9)第六节互扩散和柯肯达尔效应 (12)第三章 GA算法 (13)第一节遗传算法简介 (13)第二节基于GA法的晶粒长大模拟原理和方法 (14)第四章遗传模拟算法的具体算例 (16)第一节遗传算法模型的建立 (16)第二节模拟系统的实现 (17)第三节GA方法在材料加工中的其它应用简介 (25)第五章结论 (26)参考文献 (27)致谢 (28)第一章绪论第一章绪论第一节晶粒长大的一般概述一切经热加工或冷加工后再加热的金属材料内部都会出现再结晶过程,一切金属多晶体的加热过程都包括晶粒长大过程。
FORTRAN 程序设计01

一, Fortran 简介 二,程序流程 三,循环结构 四,数据类型 五,数组 六,过程和模块 七,输入,输出,文件 八,复习,总结
Fortran是目前国际上广泛流行的一种高级语言, 适用于科学计算.Fortran是英文FORmula TRANslation的缩写,意为"公式翻译".它 是为科学,工程问题中的那些能够用数学公式 表达的问题而设计的语言,主要用于数值计算. 这种语言简单易学,因为可以像抄写数学教科 书里的公式一样书写数学公式,它比英文书写 的自然语言更接近数学语言.Fortran语言是 第一个真正推广的高级语言.
Fortran77 (I ~ N)规则; 以(I,j,k,m,l,n)字母开头的 变量为整型. 建议编程时使用声明语句,并在 程序中加入implicit non 语句, 屏蔽(I ~ N)规则;
asb exp sin cos Asin Acos Sqrt ……
asb(x) |x| 指数运算 exp(x) exp(x) 正弦函数 sin(x) sinx 余弦函数 cos(x) cosx 反正弦 Asin(x) arcsinx 反余弦 Acos(x) arccosx 开平方 Sqrt(x) x ………………
系统为每一个常量,变量分配一个存储单元,放它的 值.
6, 数据类型
整型:(数学上的整数集合) integer(n),属性列表,变量列表 例:integer (kind=4) i,t2,pop -2147483638 ~ 2147483637 例:integer (1):: k,m -128 ~127
实型(数学上的实数集合) real(n),属性列表,变量列表 单精度: real(4), real 双精度: real(8), double real(4),:: dx,dy real(8),:: d_p,y2
fortran第3章2 Fortran语言程序设计初步PPT课件

五.如果是需要调用其他语言写的子程序, 而恰好该种语 言(例如C语言)是区分大小写的,这时就需要特别小心。
【例3_1】 如果用C写了两个子程序EIGEN和eigen,然后有如下 的FROTRAN片断:
EXTERNAL EIGEN
...
CALL EIGEN
...
上一页
END
下一页
这时它是该引用EIGEN还是eigen呢?如果所使用的
DATA I, J, K / O’1001’, 23.54, Z’5CA2’ /
上一页 下一页 停止放映
其中第一个为八进制数,第二个为十进制数,第三个为十六进制数。
第6页
七.下划线的涵义:
● 下划线的主要作用就是置于单词之间代替空格, 使得我们在命名时使用清楚的英语词汇。
● 下划线不能置于任意名称的前面,但是可以置 于名称的最后。
特殊符号 :空格 = + - * / ( ) , . ‘:
上一页 下一页 停止放映
" ! % & ; < > $ ? _ (F90中新增的字符)
第2页
上一页 下一页 停止放映
表3-1基本的FORTRAN 90/95字符集
文字字符
英文字母 A B C D E F G H I J K L M N O P Q R小写必须区分的位置
● 作为字符常量的字符串里面;
上一页
下一页
● 输入输出的纪录里面;
停止放映
● 作为编辑描述符的引号或撇号里面。
第4页
四. CVF编译平台接受小写字母。
在 OPEN 或 者 INQUIRE 语 句 里 面 的 FILE= 或 NAME= 后面是否区分大小写,也是由编译平台指定的。
matlab 程序 晶粒长大

76. if L(x,y)~=0 %如果格点不在边界区域则开始模拟
77.
78. %---------------------如果选取点为晶粒格点---------------------
79. if L(x,y)~=-1 %如果选取点为晶粒格点
135.
136. %后处理1开始---------------每interval_save_jpg次MCS后存储图形矩阵---------------%
137. if rem(step,interval_save_jpg)==0
138. figure1=figure('visible','off','PaperPosition',[3.067 9.28 14.81 11.1],'PaperSize',[20.98 29.68]);
119. set_probability=rand();
120. if exp(-(change_BG_energy-BG_energy)/T)>=set_probability
121. L(x,y)=temp_Q;
89. diff_grain_count=diff_grain_count+1;
90. diff_ss(diff_grain_count,1)=ss(ii,1);
91. diff_ss(diff_grain_count,2)=ss(ii,2);
51. 1 0
52. 1 1]; %便于随即选取所选格点周围相邻的一个格点
53.
54.
55.%开始CAS模拟
56.for step=1:step_num
Q345钢热变形奥氏体晶粒尺寸的数值模拟

24
如图 2 所示,其中 AB、CD 边定 义为刚性边,EF 为热模拟试样的 轴对称中心线,G、H 是沿轴向高 度一半的位置试样心部和边部的 节点。试样采用 Ф8×15mm 的圆 柱,变形温度 1000℃,变形速率 取 0.05s-1。根据热模拟试验数据, 建立了该钢种的材料数据库, 分别 采用 Hodgson 再结晶模型和本文
表 2 动态再结晶晶粒尺寸
Table2 Measured grain sizes after dynamic recrystallization (µm)
应变速率/s-1 温度/K 0.01 1273K 时的奥氏体晶粒尺寸(µm) 1373 K 时的奥氏体晶粒尺寸(µm) 43 72 0.1 33 60 0.3 24 47
则335900exp1080711则峰值应力1712峰值应变103313242动态再结晶晶粒尺寸研究表明当变形达到稳态流变应变后动态再结晶和动态回复造成的软化与应变硬化达到平衡动态再结晶晶粒尺寸不再随应变变化动态再结晶晶粒尺寸和初始晶粒大小无关动态再结晶晶粒尺寸同z因子有如下关系drxaz为常数z为zenerhollomon参数为了测定奥氏体晶粒尺寸沿热模拟试样的轴向切开经过砂纸研磨抛光后用过饱和苦味酸水溶液少量海鸥牌洗发膏腐蚀剂热腐加热温度在6080之间腐蚀时间大约分钟左右
(10)
5.807 Z = 42.14 ⋅ σ P
(11)
则峰值应力 σ p = 0.525 ⋅ Z 0.17
(12)
峰值应变[5] ε p = 1.33 ×10 −3 ⋅ Z 0.188
多晶材料晶粒生长的MonteCarlo计算机模拟方法_模拟异常晶粒生长

钟晓征, 陈伟元, 王豪才, 郑 军
电子科技大学 CA E 中心, 四川 成都 610054 摘 要: 晶粒生长的显微结构的演化是一种受诸多因素影响 的复杂过程。 前文已简述模拟二维正常晶粒生长所采用的基本 蒙特卡罗 (M on te C a rlo ) 方法。异常晶粒生长的最直接原因是总 体系能的改变。 而导致体系能变化的因素很多。 本文在重点分析 由于晶界能和迁移率的各向异性引起体系能量变化的基础上, 介绍模拟异常晶粒生长的基本方法, 为解决如何将实际生长环 境复杂性引入生长模型中及如何进一步模拟生长的问题提供重 要思路。 关键词: 计算机模拟; 蒙特卡罗 (M on te C a rlo ) 方法; 异常晶粒 生长 来表示。 定义晶粒间的这种相互作用为
(9)
其中, J 1 和 J 2 为正常数且 J 1 > J 2。例如, 可取 C = 7, 观察所产生 的显微结构的图形。情况 B 认为只有 2- 2 间具有较高的能量, 如图 2 所示。 其相互作用能为:
J1 E= J2
∑∑ (1 - ∆S iS j) S i > C 且 S j > C 类型 2 —— 类型 2
N N
E= -
∑∑M
i j
S iS j
( 11)
)∆ ( 12) 矩阵 M S iS j = J ( 1- ∆ S iS j ) [ 1- ( 1- Χ S iS j + S k ] 可见, 当 Χ = 1, E 的表达式与式 ( 5) 是一致的, 为正常晶粒生
《功能材料》 1999, 30 (3)
∆ S iS j) S j > C 且 S j ≤ C 类型 2 —— 类型 1
晶粒长大的Monte Carlo 模拟方法

在纯金属、合金、陶瓷等多晶材料中,晶粒长大 是最普遍的现象,对材料的性能有很重要的影响。目 前应用最多且较成熟的模拟晶粒长大的方法是Monte Carlo(MC)法[1−4],这是因为MC模拟可以揭示材料组织 演变时拓扑学和动力学特征,可以进一步将其与实际 的工艺过程结合,模拟在一定的工艺条件下的材料微 观组织的演变情况。
型以及晶粒的尺寸、形状等的影响,测量速度比其他统计方法要快。
关键词:递归统计;晶粒度; Monte Carlo方法;晶粒长大
中图分类号:TG 111.7;TP 391.9
文献标识码:A
Monte Carlo simulation of grain growth —Recursive statistics method of grain size
2.1 模型的分级 从MC模拟方法的基本思想和算法可以知道,晶
粒长大时晶界处的格点迁移是该模拟方法的主要特 征[6−13];晶粒长大过程都是由模型点阵内一系列单元 取向的转变构成晶界的迁移而实现的;模型中任何形 状的单位晶粒都是由一系列的点阵格点组成的。测定 晶粒度,实质是统计各单位晶粒所占的格点数。递归 统计法是基于模型格点(例如potts格点)的特征以及晶 粒模拟长大时只考虑最近邻的格点的影响等特征提出 的,因此,为了方便统计格点数,首先把单位晶粒占 据的所有格点,按照被统计的先后顺序分为一级格点、 二级格点、三级格点、直至n级格点。
模型的分级是为了能在统计时使统计步骤形成递 归关系。本文以二维蜂窝状格点为例,介绍在晶粒统 计计算时,对晶粒占据的所有格点进行分级的方法(分
134
中国有色金属学报
2008 年 1 月
级方法如图2所示)和优点: 1) 统计每个单位晶粒时,第一个统计到的格点即
一种基于蒙特卡罗技术的晶粒生长计算机模拟方法

收稿日期:2004202219基金项目:河南省自然基金资助项目(021*******)作者简介:张世兴,男,1970年生,焊接工程师,现在郑州大学攻读硕士学位,目前主要从事晶粒生长计算机模拟方面的研究,已发表论文5篇。
一种基于蒙特卡罗技术的晶粒生长计算机模拟方法张世兴,刘新田,林敦文(1.河南工业大学,河南郑州 450007; 2.郑州大学,河南郑州 450002)摘 要:将蒙特卡罗(MC )技术引入到晶粒生长模拟中,结合焊接工艺试验和热模拟试验,模拟了单相合金焊接热影响区(H AZ )晶粒生长过程。
首先应用实验和统计学的方法确定了材料晶粒生长的动力学模型,然后计算了焊接热循环,同时基于蒙特卡罗技术编制了模拟程序。
最后在不同焊接热输入情况下,模拟了晶粒生长过程。
模拟结果动态演示了晶粒生长过程,并且体现了焊接热钉扎效应。
模拟得出数据与试验结果非常接近,为评定焊接工艺和材料可焊性提供了依据。
关键词:计算机模拟;晶粒生长;焊接热影响区;蒙特卡罗技术中图分类号:TH12 文献标识码:A 文章编号:1006-0316(2004)06-0059-03A computer simulation method of grain grow th based on MC technologyZH ANG Shi 2xing ,LI U X in 2tian ,LI N Dun 2wen(1.H enan Vinversity of T echnology ,Zhengzhou 450007,China ;2.Zhengzhou U niversity ,Zhengzhou 450002,China)Abstract :In this paper ,M onte Carlo (MC )technology with welding experiments and thermal simulation experiments were introduced to simulate the grain growth process in welding heat affected zone (H AZ )of a single phase alloy.First ,a kinetic m odel was defined by both experimental and statistics method.Then the thermal cycle was calculated and at the same time the simulation program was w orked out based on MC technology.At last the grain growth process in H AZ was simulated during different welding heat input ,which have great in fluence on grain growth in H AZ.The result of the simulation dem onstrats the grain growth process dynamically and embodys the“thermal pin effect ”.G ood agreement between MC simulation results and the experimental results was obtained which can provide a reli 2able evidence for evaluating the welding craft and the weldability.K ey w ords :computer simulation ;grain growth ;H AZ;MC technology 晶粒生长是纯金属、合金、陶瓷等多晶材料中最普遍的现象,对材料的性能有很重要的影响。
Fortran程序总结

1.行的书写(行的长度、分行、续行)一行可以是0~132个字符,空格有意义,语句最长不超过2640个字符一行可以有多个语句,用“;”分隔一个语句可分行写,读行标记为&(放在尾部),但如为关键字,首尾均加&。
最多可有511个续行。
2.说明语句必须出现在可执行语句之前,格式说明语句(FORMAT语句)除外。
3.注释标志符:自由格式:!固定格式:C *语句分隔符:分号;(仅自由格式可以使用)续行符:自由格式:&申明标号:1到5位无符号整数空格:关键字、变量、常量内部不能用空格,但相邻两者之间须用空格4.信息处理的分类:数值处理和信息处理现代计算机工作原理:程序存储和程序控制(冯·诺依曼)1、运算器——算术运算、逻辑运算2、控制器——根据指令控制计算机工作运算器、控制器和寄存器称为中央处理器CPU3、I/O设备——提供数据传输服务4、总线——数据传输的公共通道1.机器语言:二进制代码形式,可以被计算机直接执行,不可移植2.汇编语言:用助记符来代替机器指令,容易记忆,不可移植3.高级语言:接近自然语言(英语)的程序设计语言,又称算法语言,易学、易用、易维护,可移植性好例:FORTRAN、BASIC、PASCAL、C、LISP、PROLOG等5.FORTRAN90程序是一种分块结构,由若干个程序单元块组成:主程序、外部子程序、模块、块数据单元无论是主程序单元,还是子程序单元,都是独立的程序单位,应该独立编写,它们的形式相似。
非语句行:注释语句:!后的所有字符都被编译器忽略。
可独占一行,也可在其它语句之后,空行为注释行(固定格式用C和*)6.常量的定义:常量是程序执行过程中不能变化的量。
基本数据类型有五种:整型、实型、复型、字符型和逻辑型前三种属于数值类型,后两种为非数值类型,主要用于文字处理和控制。
FORTRAN 90通过KIND值确定整数的存储开销、最大位数和取值范围,如表所示。
计算材料学Fortran程序汇总

INTEGER M(1:10000), NUMBER1(0:364), NUMBER2REAL X,YISEED=RTC()DO J=1, 10000NUMBER1=0X=RAN(ISEED)NUMBER1(0)=INT(365*X+1)JJJ=1DO I=1,364Y=RAN(ISEED)NUMBER2=INT(365*Y+1)ETR=COUNT(NUMBER1.EQ.NUMBER2)IF (ETR= =1) THENEXITELSEJJJ=JJJ+1M(J)=JJJNUMBER1(I)=NUMBER2END IFEND DOEND DODO I=1,10000IF(M(I).LE.23) SUM=SUM+1END DOPRINT *,SUM/10000END=================================================Monte Carlo Simulation of One Dimensional DiffusionINTEGER X,XX(1:1000,1:1000)REAL XXM(1:1000)! X:INSTANTANEOUS POSITION OF ATOM! XX(J,I):X*X ,J:第几天实验,I:第几步跳跃! XXM(I): THE MEAN OF XXWRITE(*,*) "实验天数JMAX,实验次数IMAX"READ(*,*) JMAX,IMAXISEED=RTC()DO J=1,JMAX !第几天实验X=0 !!!DO I=1,IMAX !第几步跳跃RN=RAN(ISEED)IF(RN<0.5)THENX=X+1ELSEX=X-1END IFXX(J,I)=X*XEND DOEND DOOPEN(1,FILE="C:\DIF1.DAT")DO I=1,IMAXXXM=0.0XXM(I)=1.0*SUM(XX(1:JMAX,I))/JMAX !!WRITE(1,*) I, XXM(I)END DOCLOSE(1)END============================================================ ! Monte Carlo Simulation of Two Dimensional DiffusionINTEGER X,Y,XY(1:1000,1:1000)REAL XYM(1:1000)! X:INSTANTANEOUS POSITION OF ATOM! XY(J,I):X*Y ,J:第几天实验,I:第几步跳跃! XYM(I): THE MEAN OF XYWRITE(*,*) "实验天数JMAX,实验次数IMAX"READ(*,*) JMAX,IMAXISEED=RTC()DO J=1,JMAX !第几天实验X=0 !!!Y=0 !!!DO I=1,IMAX !第几步跳跃RN=RAN(ISEED)IF(RN.LT.0.25)THENx=xy=y-1END IFIF(RN.LT.0.5.AND.RN.GE.0.25)THENx=xy=y+1END IFIF(RN.LT.0.75.AND.RN.GE.0.5)THENx=x-1y=yEND IFIF(RN.GE.0.75)THENx=x+1y=yEND IFXY(J,I)=X*X+Y*YEND DOEND DOOPEN(1,FILE="C:\DIF2.DAT")DO I=1,IMAXXYM=0.0XYM(I)=1.0*SUM(XY(1:JMAX,I))/JMAX !!WRITE(1,*) I, XYM(I)END DOCLOSE(1)END===============================================! Monte Carlo Simulation of One Dimensional Diffusion INTEGER X,XY(1:1000,1:1000),y,XN(1:4),YN(1:4),RNREAL XYM(1:1000)! X:INSTANTANEOUS POSITION OF ATOM! XY(J,I):X*Y ,J:第几天实验,I:第几步跳跃! XYM(I): THE MEAN OF XYWRITE(*,*) "实验天数JMAX,实验次数IMAX"READ(*,*) JMAX,IMAXXN=(/0,0,-1,1/)YN=(/-1,1,0,0/)ISEED=RTC()DO J=1,JMAX !第几天实验X=0 !!!Y=0 !!!DO I=1,IMAX !第几步跳跃RN=4*RAN(ISEED)+1X=X+YN(RN)Y=Y+YN(RN)XY(J,I)=X*X+Y*YEND DOEND DOOPEN(1,FILE="C:\DIF2.DAT")DO I=1,IMAXXYM=0.0XYM(I)=1.0*SUM(XY(1:JMAX,I))/JMAX !!WRITE(1,*) I, XYM(I)END DOCLOSE(1)END做三维空间随机行走??留作业! Monte Carlo Simulation of One Dimensional Diffusion INTEGER X,XY(1:1000,1:1000),y,XN(1:6),YN(1:6),ZN(1:6),RN REAL XYM(1:1000)! X:INSTANTANEOUS POSITION OF ATOM! XY(J,I):X*Y ,J:第几天实验,I:第几步跳跃! XYM(I): THE MEAN OF XYWRITE(*,*) "实验天数JMAX,实验次数IMAX"READ(*,*) JMAX,IMAXXN=(/0,0,-1,1,0,0/)YN=(/-1,1,0,0,0,0/)ZN=(/0,0,0,0,1,-1/)ISEED=RTC()DO J=1,JMAX !第几天实验X=0 !!!Y=0 !!!Z=0DO I=1,IMAX !第几步跳跃RN=6*RAN(ISEED)+1X=X+XN(RN)Y=Y+YN(RN)Z=Z+ZN(RN)XY(J,I)=X*X+Y*Y+Z*ZEND DOEND DOOPEN(1,FILE="C:\DIF2.DAT")DO I=1,IMAXXYM=0.0XYM(I)=1.0*SUM(XY(1:JMAX,I))/JMAX !!WRITE(1,*) I, XYM(I)END DOCLOSE(1)==============================================通过该程序了解fortran语言如何画图(通过像素画图)USE MSFLIBINTEGER XR,YR !在的区域中画一个圆PARAMETER XR=400,YR=400INTEGER R, S(1:XR,1:YR)X0=XR/2 ! 圆心位置X0,YOY0=YR/2R=MIN(X0-10,Y0-10) !圆半径S=0 !像素的初始状态(颜色)DO I=1,XRDO J=1,YRIF((I-X0)**2+(J-Y0)**2<=R**2)S(I,J)=10IER=SETCOLOR(S(I,J))IER=SETPIXEL(I,J)END DOEND DOEND=================================================! 画一个圆(1、如何选出晶界区域;2、进一步加深对画图的理解)USE MSFLIBINTEGER XR,YR !在的区域中画一个圆PARAMETER XR=400,YR=400INTEGER R, S(0:XR+1,0:YR+1), XN(1:4), YN(1:4), SNSXN=(/0,0,-1,1/)YN=(/-1,1,0,0/)X0=XR/2 ! 圆心位置X0,Y0Y0=YR/2R=MIN(X0-10,Y0-10) !圆半径S=0 !像素的初始状态(颜色)DO I=1,XRDO J=1,YRIF((I-X0)**2+(J-Y0)**2<=R**2)S(I,J)=10IER=SETCOLOR(S(I,J))IER=SETPIXEL(I,J)END DOEND DODO I=1,XR !画晶界DO J=1,YRNDS=0DO K=1,4IF(S(I,J).NE.S(I+XN(K),J+YN(K)))NDS=NDS+1END DOIF(NDS>0)THENIER=SETCOLOR(9)ELSEIER=SETCOLOR(8)END IFIER=SETPIXEL(I,J)END DOEND DOEND如何画有一定宽度的晶界?====================================================!MC模拟一个晶粒的缩小(1、如何定义基体和晶粒;(2、如何寻找边界;(3、如何计算能量(构造或描述问题的概率过程)步骤:1、在基体上画一个原始晶粒,并赋予基体和原始晶粒不同的状态(取向号或体积能)2、寻找晶界3、MC的一个时间步(晶粒长大过程中一种随机性)4、计算晶界上网格点的相互作用,每个格点的相互作用导致晶粒长大①随机选取一个初始格点;②若此点属于晶界,那么可以随机转变为它邻居的状态,若不是晶界,则跳出循环,不发生转变;③计算转变前后的能量变化,⊿E=⊿E v +⊿E s +⊿E q(自由能=体积能+表面能+能量起伏)④若⊿E小于0,则新晶相被接受,网格状态发生转变。
晶体生长软件FEMAG教程之材料赋予

FEMAGCZVersion 2.10Homework 2wxCreGeoDecember 10, 2008FEMAG Soft S.A. LouvainlaNeuve, Belgium Table of Contents1. HOMEWORK GOALS (4)2. ASSOCIATED FILES (4)3. WXCREGEO (4)3.1. Starting wxCreGeo (4)3.2. Import geometry file (5)3.3. Material file (5)3.4. Set material properties (5)3.5. Change the material parameters (8)3.6. Set operating conditions and computational parameters (8)3.7. Ending (10)4. CONTROL ARCHIVE FILE (10)5. SUMMARY (10)5.1. Program features and file results (10)5.2. Procedures: if I want to (11)5.3. Important remark (11)FEMAGCZ 2.10Homework 22Typographic attributes used in this manualSymbols used in this manualContactsupport@FEMAGCZ 2.10Homework 23Homework goals1. Homework goalsAt the end of this homework, you should be able:–to visualize your 2D mesh.–to assign the appropriate material type to the different parts of the puller and hence to set the material properties to each part.–to set the operating process conditions (kinematics, thermal conditions, gas and melt flow, magnetic field).–to set the computational parameters (local and global convergence criteria, time duration of a step (if time dependent problem)).2. Associated filesThis homework is based on the previous homework, the corresponding archive being “ctrl_geotool.tgz”.If required, please extract the “ctrl_geotool.tgz” archive in the “training/” working directory.3. wxCreGeowxCreGeo is the FEMAGCZ module used for mesh visualization and for the input of all material parameters, boundary conditions, operating conditions, and computational parameters.3.1. Starting wxCreGeoStart wxCreGeo by running wxcregeo from your working directory.wxCreGeo is organized in two windows:•the main window organized in four parts: the menu bar, main field, computation log and status line.•the “Plot/Tree View” window (Illustration 1) displaying the geometry and the list of macroelements composing the geometry.Closing the main window terminates the program. Closing secondary (plot and tree view) windows hides them. Using right mouse button in plot and tree view gives access to the pulldown menu commands.FEMAGCZ 2.10Homework 24Illustration 1 Geometry mesh display3.2. Import geometry fileImport the files containing the mesh by means of File>Import project..., choose the “training.ini” file, and press <OK>.In the plot panel of “Plot/Tree View” window (Illustration 1), you can visualize the 2D mesh by pressing <Display/hide mesh>. In the tree list of the same window, you can see the list of the macroelements.3.3. Material fileThe material data are stored in a database. FEMAGCZ uses two databases:–The default database is linked to the wxCreGeo user interfaces, and proposes default material data. The default database is loaded with the wxCreGeo interface opening. This database is stored on your computer system into a material file using the “.mat” filename extension.–The current database is linked to a specific model, and proposes the material data linked to this model. This material database is loaded when the specific model is opened in wxCreGeo. This database is stored in the “.h5” file corresponding to the model.A standard material database, “default.mat” had to be installed with FEMAGCZ.If you have not yet created your own material files, copy the default one “default.mat” provided with FEMAGCZ distribution into another name, e.g. “myFile.mat”. It is better to work with your own material file because, in case of new FEMAGCZ installation, existing “default.mat” could be replace by the default file.3.4. Set material properties1.In the main window, select Option>Materials file..., and choose the materials file you will use(“myFile.mat”).Run Materials>reset to default to update the current material database.2.For each 1D, 2D or melt/crystal macroelement, set its material properties: with the right mousebutton, click on it in the plot panel or in the tree list and select Set Material from the pulldown menu. In the material selection box you have to choose between:•a predefined material from the list. These predefined materials are stored in the materials file.•a “local” noname material associated only with the concerned macroelement. In this case, you have to complete the material setting sheet.We use the following predefined materials:FEMAGCZ 2.10Homework 25Click on it and select your material For example, in order to set material for the melt/crystal macroelement, click on “mc” in the tree list and select Set Material from the tree view pulldown menu. Then, choose “Silicon” from thematerial predefined list (Illustration 2).FEMAGCZ 2.10Homework 263.In order to easily visualize the macroelement material in the plot panel, you can assign a color to each material.Two possible ways:•Materials>Edit current...: to edit the current material database, i.e. changes will only be taken into account for the current model.•Materials>Edit default...: to edit the global material database, i.e. changes will be saved in the materials file and taken into account for all other geometries.In the materials editor, set the material colors (Illustration 3), select File>Save and finally, File>Exit . Come back in wxCreGeo main window, to take changes into account you have to do:•View>Refresh , if you performed changes by Edit current...•Materials>Reset to default followed by View>Refresh , if you performed changes by the other way.To turn filling on/off, select View>Fill 2D(i).FEMAGCZ 2.10Homework 27Click in the field and choose your color3.5. Change the material parameters1.Change the insulator thermal conductivity of the global database:1.Run Materials>Edit default... .The default database (as defined in Options>Material File...) is automatically loaded in the material editor window. Remind you that this database is linked to the wxCreGeo user interfaces. It is loaded with the wxCreGeo interface opening.2.In the “Solid materials” panel, select the “Insulator” item from the material list.3.Change the thermal conductivity from 1 W/mK to 0.15 W/mK.4.select File>Save and File>Exit.Come back in wxCreGeo main window, to take changes into account you have to run Materials>Reset to default followed by View>Refresh.2.Change the molten silicon thermal conductivity only for the current simulation problem:1.Run Materials>Edit current...2.The current database is automatically loaded in the material editor window. Remind you thatthe current is linked to the model you are editing, and proposes the material data linked to this model. This material database is loaded when the specific model is opened in wxCreGeo. This database is stored in the “.h5” file corresponding to the model.3.In the “2Di materials”, select the “Silicon [FEMAGSoft 2005]” item from the material list.4.Change the melt thermal conductivity from 42.9 W/mK to 110 W/mK.5.select File>Save and File>Exit.Come back in wxCreGeo main window, to take changes into account you have to run View>Refresh.In case of simulation without melt convection computation, the effect of the melt flow on the heat transfer can still be modeled by means of an enhanced melt thermal conductivity of the molten silicon, which sums up the contributions of heat convection and diffusion.3.You can check by means of Materials>Edit default... that the molten silicon thermal conductivityin the default database is still 42.9 W/mK. Whereas, the insulator thermal conductivity is set to0.15 W/mK in both databases.3.6. Set operating conditions and computational parameters◆Kinematics•Set the seed velocity to 0.1 mm/min.•Keep gravity to 9.81 m/s2.•Set the crystal rotation rate to 20 RPM.Define the following domains as rotating with the crystal: “training_pull_rod” and “mc”.•Set the crucible rotation rate to 15 RPM.Define the following domains as rotating with the crucible: “cement”, “training_crucible” and “training_support” (use “Select” button to access the selection window).◆Thermal operating conditions•Set a specific adaptive power of 10,000 [W/m3] on the heater macroelement (training_heater).Select the “training_heater” macroelement from the list, imposed a specific power of 10,000 W/m3, select “adaptive” option and click on <Apply>.The actual heater power will be computed in order that the computed temperature of the trijunction point fit with the crystal melting temperature.FEMAGCZ 2.10Homework 28•Specify external boundary conditions (Illustration 4) by pressing on the corresponding button. Keep a temperature of 300 K along the furnace shell except for gas outlet having a flux boundary condition q=100*(T300) W/m 2.•We do not use particular emissivities and additional fluxes.In order to specify particular emissivities and additional fluxes you have to press the corresponding button to open the dialog window. Choose sides alternatively and specify value for T0, h and emissivity. Then, press <OK>.•We do not have to define additional temperature control points.Please remember that the actual heater power will be computed in order that the computed temperature of the control point fit with the imposed temperature. In case of ingot growth, the trijunction point is constrained to be a temperature control point.The number of temperature control point has to be equal to 1 or to the number of adaptive heater power. Hence, in the current case, the number of adaptive heater power being equal to 1, the number of temperature control point must be equal to 1.◆Gas flow mode l •Select the “e01_gas” gas enclosure item.•Tick off “With inlets and outlets” box and specify the inlet sides ID's and the outlet side ID's. Please remember that several inlet/outlet sides can be defined.•Set the furnace pressure to 0.015 bar.•Set the flow rate per inlet side by pressing the corresponding <Edit> button. For the inlet side ID 180, impose a flow rate of 0.030 m 3/s at the specified pressure. Click on <Apply>.•Set the gas flow computational parameters:–The relaxation coefficient allows to relax the effect of the gas flow on the temperature field.The relaxation coefficient can be increased to 0.8 ... 0.9 in case of horizontal temperature profile in cavity. However, by increasing the relaxation coefficient, you increase the iteration number and hence the computational time.Please note that the global solution is not affected by this parameter.Keep default value (0.5).–The convergence criterion can be used to reduce the computational accuracy. This is interesting in case of intermediate computations such as used in stepbystep procedure. In this case, decrease the accuracy for intermediate computation and increase it for the final solution. As the accuracy is reduced, the computational time is reduced, too.Define a value of 1.0e05.•Click on <Apply>.FEMAGCZ 2.10Homework 29Illustration 4: External boundary conditiondialog box.◆Melt flow modelThis panel allows to choose the melt flow model parameters. This panel can be neglected in a first stage.◆Magnetic fieldsWe do not yet use magnetic fields. The data related to magnetic field will be set in a later stage.◆Computational parametersYou have to define the crystal and melt boundary conditions by pressing the corresponding button. Define a temperature condition along crystal wall and melt free surface (except on the sides adjacent to the trijunction point), while keeping default parameter elsewhere. Change the convergence criteria for the global and local iterations to:–Trijunction temperature: 0.1 K.–Interface position: 0.1 mm–Convergence tolerance: 1.000e04.3.7. EndingSave input data as “couplage/data/training.h5” file by doing File>Save.When everything is completed, do File>Export Geometry to generate files needed for the computation. Now, you can exit wxCreGeo and start your FEMAGCZ simulation.Note: When running wxCreGeo in a later stage, you can read the “training.h5” file by doing File>Open (useful to make modifications).4. Control archive fileMake the “ctrl_wxcregeo.tgz” control archive file of your working directory (Linux command: tar cvzf ctrl_wxcregeo.tgz ./*) and send it to support@.5. Summary5.1. Program features and file resultswxcregeo program:–Main actions: to assign material properties to the different parts of the puller and to define the operating conditions and the computational parameters.–Input:–material data (“./couplage/exe/default.mat”)–operating conditions (kinematics, thermal conditions, gas and melt flow, magnetic field)–computational parameters (local and global convergence criterions, time duration of a step (if time dependent problem))–Output files:–“./couplage/data/GID.h5” (produced by File>Save): file produced to be opened by wxCregeo in order to make modifications to the project.FEMAGCZ 2.10Homework 210Summary5.2. Procedures: if I want to ...If I want to change the insulator thermal conductivity of the global database:1.Run Materials>Edit default... .2.The default database (as defined in Options>Material File...) is automatically loaded in thematerial editor window. Remind you that this database is linked to the wxCreGeo user interfaces. It is loaded with the wxCreGeo interface opening.3.In the “Solid materials” panel, select the “Insulator” item from the material list.4.Change the thermal conductivity from 1 W/mK to 0.15 W/mK.5.select File>Save and File>Exit.Come back in wxCreGeo main window, to take changes into account you have to run Materials>Reset to default followed by View>Refresh.If I want to change the molten silicon thermal conductivity only for the current simulation problem:1.Run Materials>Edit current...2.The current database is automatically loaded in the material editor window. Remind you that thecurrent is linked to the model you are editing, and proposes the material data linked to this model.This material database is loaded when the specific model is opened in wxCreGeo. This database is stored in the “.h5” file corresponding to the model.3.In the “2Di materials”, select the “Silicon” item from the material list.4.Change the melt thermal conductivity from 42.9 W/mK to 110 W/mK.5.select File>Save and File>Exit.Come back in wxCreGeo main window, to take changes into account you have to run View>Refresh.5.3. Important remarkWhen inverse simulations are considered, namely when the heater power required to growth a prescribed ingot shape is looked for, the number of adaptive power has to be at least equal to the number of control points. In case of ingot growth, the trijunction point is constrained to be a temperature control point. Therefore, at least one macroelement has to be defined has adaptive in that case.FEMAGCZ 2.10Homework 211。
基于ABAQUS二次开发的轧制过程组织性能预测

基于ABAQUS二次开发的轧制过程组织性能预测付晓杰;杜晓钟;黄庆学【摘要】考虑到实际板带轧制过程中组织性能预测的精度缺陷,基于低合金钢轧制过程动态再结晶型的真实应力-应变数学模型及微观组织模型,通过VUMAT及USDFLD数据接口,依托于ABAQUS有限元软件,对软件材料子程序及其微观组织模型进行了二次开发研究,最后对Q345B板带的热轧制过程进行了模拟验证.研究结果表明:模型的预测精度较高,板带横截面处各部位的静态软化率和奥氏体晶粒直径差别较大,板带中心处的奥氏体晶粒分布比较均匀,板带侧面及表面奥氏体晶粒细化程度不大,要靠后续的精轧过程继续细化.【期刊名称】《太原科技大学学报》【年(卷),期】2015(036)005【总页数】7页(P362-368)【关键词】材料本构模型;ABAQUS二次开发;组织性能预测;轧制过程模拟;动态再结晶【作者】付晓杰;杜晓钟;黄庆学【作者单位】太原科技大学重型机械教育部工程研究中心,太原0300240;太原科技大学重型机械教育部工程研究中心,太原0300240;太原科技大学重型机械教育部工程研究中心,太原0300240【正文语种】中文【中图分类】TG335.5在轧制过程中,金属变形抗力值的大小是计算轧制过程的力和功,制定合理的轧制工艺规程,设计和校核轧制设备的重要依据。
衡量轧制产品质量的标准既取决于产品最终形状和尺寸的外部质量又取决于产品性能的内部质量。
从宏观方面进行控制就要制定合理的轧制规程,这就要求对力能参数进行精确的计算。
准确的本构关系模型是轧制过程中材料的动态响应与热力参数的媒介,是用数值分析方法对轧制过程进行数值模拟的前提条件。
从微观方面进行控制就要控制内部微观组织,在化学成分确定的情况下,微观组织晶粒度是衡量内部微观组织的重要标准。
在钢材料的本构关系研究中,学术界提出了不同类型的钢本构关系模型。
Maheshwari等[1]提出的修正Johnson-Cook模型,此模型是基于隐式算法需要进行平衡迭代,计算慢,容易出现不收敛的问题。
计算材料学作业

用蒙特卡罗方法估计圆周率 值.其fortran语言程序如下:REAL R,R1,R2,PIISEED=RTC()N0=0N=300000DO I=1,NR1=RAN(ISEED)R2=RAN(ISEED)R=SQRT(R1*R1+R2*R2)IF(R<1.0)N0=N0+1END DOPI=4.0*N0/Ndo J=1,5write(*,*)end doWRITE(*,*)”用MC方法估算的圆周率为”WRITE(*,*)PIEND其运行结果如下:用蒙特卡罗方法计算定积分.其fortran语言程序如下:REAL YY=0N=300000ISEED=RTC()DO I=1,NX=RAN(ISEED)Y=Y+X**2/N !计算x^2在[0,1]上的定积分END DOdo J=1,5write(*,*)end doWRITE(*,*)"用MC方法计算x^2在[0,1]上的定积分为"WRITE(*,*)YEND其运行结果如下:用蒙特卡罗方法模拟一维随机行走 其fortran 语言程序如下:INTEGER X,XX(1:1000,1:1000) REAL XXM(1:1000)! X:INSTANTANEOUS POSITION OF ATOM ! XX(J,I):X*X ,J:第n 个原子,I:第几步跳跃 !XXM(I): THE MEAN OF XXWRITE(*,*) “原子个数JMAX ,跳动次数 IMAX" READ(*,*) JMAX,IMAX ISEED=RTC() DO J=1,JMAX !第n 个原子跳跃 X=0 DO I=1,IMAX !第几步跳跃 RN=RAN(ISEED) IF(RN<0.5)THENX=X+1ELSE X=X-1 END IF XX(J,I)=X*X END DO END DOOPEN(1,FILE=“f:\DIF1.DAT") DO I=1,IMAX XXM=0.0XXM(I)=1.0*SUM(XX(1:JMAX,I))/JMAX !! WRITE(1,*) I, XXM(I) END DO CLOSE(1)END其运行结果如下:符合 = 的理论关系.用蒙特卡罗方法模拟晶界其fortran语言程序如下:USE MSFLIBINTEGER XR,YR !在的区域中画一个圆PARAMETER XR=400,YR=400INTEGERR,S(0:XR+1,0:YR+1),XN(1:4),YN(1:4),SNS XN=(/0,0,-1,1/)YN=(/-1,1,0,0/)X0=XR/2 ! 圆心位置X0,Y0Y0=YR/2R=MIN(X0-10,Y0-10) !圆半径S=0 !像素的初始状态(颜色)DO I=1,XRDO J=1,YRIF((I-X0)**2+(J-Y0)**2<=R**2)S(I,J)=10IER=SETCOLOR(S(I,J))IER=SETPIXEL(I,J)END DOEND DODO I=1,XR !画晶界DO J=1,YRNDS=0DO K=1,4IF(S(I,J).NE.S(I+XN(K),J+YN(K)))NDS=NDS+ 1END DOIF(NDS>0)THENIER=SETCOLOR(9)ELSEIER=SETCOLOR(8)END IFIER=SETPIXEL(I,J)END DOEND DOEND其运行结果如下:用MC方法模拟单晶粒长大其fortran语言程序如下:USE MSFLIBPARAMETER IR=400,JR=400NTEGERIS(0:IR+1,0:JR+1),TMAX,ISN(1:8),N STATE,T,NR,IX,IYWRITE(*,*)"PLEASE INPUT THE TIME STEP "READ(*,*)TMAXISEED=RTC()IRC=IR/2JRC=JR/2IS=10IS(IRC,JRC)=2OPEN(1,FILE="E:\LUKE.DAT")DO T=1,TMAXDO X=1,IRDO Y=1,JRIX=IR*RAN(ISEED)+1JY=JR*RAN(ISEED)+1ISN=(/IS(IX-1,JY-1),IS(IX-1,JY),IS(IX -1,JY+1),IS(IX,JY-1)&,IS(IX,JY+1),IS(IX+1,JY-1),IS(IX+1, JY),IS(IX+1,JY+1)/)E0=COUNT(ISN.NE.IS(IX,JY))IF(E0.EQ.0)CYCLENR=8*RAN(ISEED)+1NSTATE=ISN(NR)E=COUNT(ISN.NE.NSTATE)RD=RAN(ISEED)DE=E-E0+NSTATE-IS(IX,JY)+2.5*RD-1.25IF(DE.LT.0.0)IS(IX,JY)=NSTATEISRE=SETCOLOR(IS(IX,JY))ISRE=SETPIXEL(IX,JY)ENDDOENDDOWRITE(1,*)T,SQRT(1.0*COUNT(IS.EQ.2))ENDDOCLOSE(1)ENDUSE MSFLIBPARAMETER IR=400,JR=400INTEGERIS(0:IR+1,0:JR+1),TMAX,ISN(1:8),NSTATE,T,NR,IX,IYWRITE(*,*)"PLEASE INPUTTHE TIME STEP "READ(*,*)TMAXISEED=RTC()IRC=IR/2JRC=JR/2IS=10IS(IRC,JRC)=2OPEN(1,FILE="E:\LUKE.DAT")DO T=1,TMAXDO X=1,IRDO Y=1,JRIX=IR*RAN(ISEED)+1JY=JR*RAN(ISEED)+1ISN=(/IS(IX-1,JY-1),IS(IX-1,JY),IS(IX-1,JY+1),IS(IX,JY-1)&,IS(IX,JY+1),IS(IX+1,JY-1),IS(IX+1,JY),IS(IX+1,JY+1)/)E0=COUNT(ISN.NE.IS(IX,JY))IF(E0.EQ.0)CYCLENR=8*RAN(ISEED)+1NSTATE=ISN(NR)E=COUNT(ISN.NE.NSTATE)RD=RAN(ISEED)DE=E-E0+NSTATE-IS(IX,JY)+2.5*RD-1.25IF(DE.LT.0.0)IS(IX,JY)=NSTATEISRE=SETCOLOR(IS(IX,JY))ISRE=SETPIXEL(IX,JY)ENDDOENDDOWRITE(1,*)T,SQRT(1.0*COUNT(IS.EQ.2))ENDDOCLOSE(1)END其运行结果如下:计算材料学第六次试验报告氧化层增重其fortran语言程序如下:integer t1,t2real w1,w2,kwrite(*,*)"第一次氧化时间t1,氧化后增重w1,二次氧化时间t2"read(*,*)t1,w1,t2k=w1**2/t1w2=sqrt(k*(t1+t2))write(*,*)"则第二次氧化后增重:"write (*,*)w2end其运行结果如下:计算材料学第七次试验报告用MC方法模拟多晶粒长大其fortran语言程序如下:USE MSFLIBPARAMETER IR=400,JR=400,NMAX=100 INTEGERIS(0:IR+1,0:JR+1),TMAX,ISN(1:8),NSTATE,T,NR,I X0,IY0,IX,IYINTEGER IGV(0:NMAX)! 读取晶粒生长步长;WRITE(*,*)"PLEASE INPUT THE TIME STEP "READ(*,*)TMAXISEED=RTC()! 定义晶粒长大位置(100个形核点初始形核位置),并附已不同的取向号DO I=1, NMAXIX0=IR*RAN(ISEED)+1JY0=JR*RAN(ISEED)+1IS(IX0,JY0)=IEND DO! 边界条件IS(0,1:JMAX)=IS(IMAX,1:JMAX)IS(IMAX+1,1:JMAX)=IS(1,1:JMAX)IS(0:IMAX+1,0)=IS(0:IMAX+1,JMAX) IS(0:IMAX+1,JMAX+1)=IS(0:IMAX+1,1)OPEN(1,FILE="E:\LUKE.DAT")! 定义基体体积能为10,所有晶粒体积能为1IGV=1IGV(0)=10! 寻找晶粒边界。
金属材料晶粒长大过程建模

金属材料晶粒长大过程建模金属材料晶粒长大过程是材料科学中一个重要的研究领域。
通过建立晶粒长大的数学模型,可以更好地理解金属材料的结构演化规律,为材料制备和性能优化提供指导。
晶粒是金属材料中具有规则排列的晶体结构单元。
晶粒长大是指晶粒尺寸增大的过程。
晶粒长大可以通过固相结晶、溶液中沉淀、晶界迁移等方式实现。
在金属材料的热处理过程中,晶粒长大的控制是关键,因为晶粒尺寸对材料的力学性能、热导率和耐腐蚀性能等都有重要影响。
为了准确描述晶粒长大过程,建模是必不可少的工具。
常用的建模方法包括统计模型和物理模型。
统计模型基于统计力学原理,通过假设晶粒间的相互作用是统计独立的,利用概率论和随机过程进行描述。
物理模型则基于材料的微观结构和热力学原理,通过考虑晶体内部的扩散、位移和变形等现象来描述晶粒长大过程。
在统计模型中,晶粒长大通常被建模为一个随机过程。
最常见的统计模型是蒙特卡洛模拟,通过随机生成晶粒生长的路径,直到达到稳定状态。
蒙特卡洛模拟可以有效地描述晶粒的尺寸分布、晶粒生长速率和晶粒边界的运动等。
此外,还有基于排他性模型的等高线模型和随机移动模型等用于建模晶粒长大的方法。
物理模型则更加注重描述晶体内部的微观现象。
通过考虑晶界扩散、沉淀和位错等过程,可以建立起更精确的模型。
例如,凯文-库尔佩模型通过考虑晶界的位错扩散、晶内的位错发射和晶粒边界的几何形变等因素,对晶粒长大进行了较为准确的描述。
此外,基于有限元分析和相场模型等方法也被广泛应用于晶粒长大建模中。
无论是统计模型还是物理模型,建模的过程都需要考虑多种因素,如晶界能、表面张力、扩散速率和温度梯度等。
这些因素对晶粒长大过程的形成和发展起到决定性的作用。
因此,建模过程需要合理选择参数和适当的密度函数来描述这些因素的影响。
金属材料晶粒长大过程的建模具有一定的挑战性。
首先,晶粒长大是一个复杂的动力学过程,需要考虑多个变量的相互作用。
其次,材料的物理性质随温度和成分的变化而变化,需要建立合适的材料参数模型。
deform晶粒模拟

晶粒模拟1.输入变形主要文件2.输入与晶粒有关的材料参数3.输入最初的晶粒变量4.运行模拟5.准备及运行空冷模拟6.准备及运行水中淬火模拟7.后处理8.改变条件介绍本章的目的是介绍如何采用DEFORM-2D晶粒模拟。
模拟锻造过程及热处理过程中微观组织的变化。
再结晶度及平均晶粒尺寸是使用者最关心的参数,该模型中共有16种晶粒变量,他们都放在数据库中。
静态再结晶、中间动态再结晶、动态再结晶的演化机理和结晶成长都在模型中被计算。
在每一个时间步里,基于时间、温度、应力、应力速率、演化历史,变形机制被定义,晶粒的变化被计算和更新。
关于该模拟完整的解释在用户文档中有。
注意:1)由于锻造过程的复杂性,对动态再结晶的同步模拟几乎是不可能的。
实际上动态再结晶的计算是在变形过程之后。
中间动态再结晶,动态再结晶也是如此。
这就是说,用户将看不到任何的结果除非一个非变形的模拟(例如:热处理)跟在一个变形模拟的后面。
2)要完成一个完整的晶粒变化模拟,用户必须确定一个完整的热处理过程。
特别是坯料必须在模拟结束时彻底的冷却。
问题摘要空冷水中淬火是一个既简单又让人头疼的过程,该问题使用SI单位,轴对称。
材料IN718,模具材料H13钢。
1.输入变形主要文件做一个工作路径,打开DEFORM 2D,用Problem ID GRAIN_LAB, 打开前处理,装载KEY文件UPSET.KEY.这个KEY文件包含了该模拟的所有信息。
2.输入与晶粒有关的材料参数点击模拟控制按纽,激活“晶粒”,到材料中选择IN718,点击晶粒窗口,窗口显示如下:激活meta-dynamic、grain growth,不激活其他俩个,输入以下数据到相应的矩阵。
最高应力应变速率极限中间动态再结晶动力中间动态再结晶晶粒尺寸晶粒生长这些数都是温度或应变速率的函数。
矩阵的第一栏定义了这个数的温度或应变速率,如果这个数是不受温度或应变速率约束的,那么矩阵的第一栏是不重要的。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
!原子的三维跳跃integer x,y,z,xyz(1:1000,1:1000),xn(1:6),yn(1:6),zn(1:6),rn real xyzm(1:1000)write(*,*)"实验天数Jmax,实验次数Imax"read(*,*) jmax,imaxxn=(/0,0,0,0,1,-1/)yn=(/0,0,-1,1,0,0/)zn=(/1,-1,0,0,0,0/)iseed=rtc()do j=1,jmaxx=0y=0z=0do i=1,imaxrn=6*ran(iseed)+1x=x+xn(rn)y=y+yn(rn)z=z+zn(rn)xyz(j,i)=x*x+y*y+z*zend doend doopen(1,file="F:\089024352yi.dat")do i=1,imaxxyzm=0xyzm(i)=1.0*sum(xyz(1:jmax,i))/jmaxwrite(1,*) i,xyzm(i)end doclose(1)end!MC单晶长大use msflibparameter ir=400,jr=400integer is(0:ir+1,0:jr+1),tmax,isn(1:8),nstate,t,nr,ix,iy write(*,*)"please input the time step"read(*,*)tmaxiseed=rtc()irc=ir/2jrc=jr/2r=min(irc,jrc)-10is=10is(irc,jrc)=2open(1,file="f:\089024352er.dat")do t=1,tmaxdo x=1,irdo y=1,jrix=ir*ran(iseed)+1jy=jr*ran(iseed)+1isn=(/is(ix-1,jy-1),is(ix-1,jy),is(ix-1,jy+1),is(ix,jy-1), !is(ix,jy+1),is(ix+1,jy-1),is(ix+1,jy),is(ix+1,jy+1)/) e0=count(isn.ne.is(ix,jy))if (e0.eq.0) cyclenr=8*ran(iseed)+1nstate=isn(nr)e=count(isn.ne.nstate)rd=ran(iseed)de=e-e0+7*(nstate-is(ix,jy))+2.5*rd-1.25if (de.lt.0.0) is(ix,jy)=nstateisre=setcolor(is(ix,jy))isre=setpixel(ix,jy)end doend dowrite(1,*) t, sqrt(1.0*count(is.eq.2))end doclose(1)end!MC多晶长大use msflibparameter ir=400,jr=400,nmax=100integer is(0:ir+1,0:jr+1),tmax,isn(1:8),nstate,!t,nr,ix0,iy0,ix,iyinteger igv(0:nmax)write(*,*)"please input the time step"read(*,*)tmaxiseed=rtc()! is=0do i=1,nmaxix0=ir*ran(iseed)+1jy0=jr*ran(iseed)+1is(ix0,jy0)=iend do!is(0,1:jmax)=is(imax,1:jmax)!is(imax+1,1:jmax)=is(1,1:jmax)!is(0:imax+1,0)=is(0:imax+1,jmax)!is(0:imax+1,jmax+1)=is(0:imax+1,1)open(1,file="F:\089024352san.dat")igv=1igv(0)=10do t=1,tmax! iarea=0is(0,0:jr+1)=is(ir,0:jr+1)is(ir+1,0:jr+1)=is(1,0:jr+1)is(0:ir+1,0)=is(0:ir+1,jr)is(0:ir+1,jr+1)=is(0:ir+1,1)do x=1,irdo y=1,jrix=ir*ran(iseed)+1jy=jr*ran(iseed)+1isn=(/is(ix-1,jy-1),is(ix-1,jy),is(ix-1,jy+1),is(ix,jy-1),! is(ix,jy+1),is(ix+1,jy-1),is(ix+1,jy),is(ix+1,jy+1)/)e0=count(isn.ne.is(ix,jy))if(e0.eq.0)cyclenr=8*ran(iseed)+1nstate=isn(nr)rd=ran(iseed)e=count(isn.ne.nstate)ig=igv(isn(nr))-igv(is(ix,jy))de=ig+e-e0+2.5*rd-1.25if(de.lt.0.0) is(ix,jy)=nstateiii=mod(is(ix,jy),15)if(iii==0)iii=iii+1isre=setcolor(iii)isre=setpixel(ix,jy)! if(is(ix,jy).ne.10)iarea=iarea+1end doend do! write(1,*)t,1.0*iareawrite(1,*)t,sqrt(1.0*count(is.ne.0))end doclose(1)end!CA单晶长大use msflibparameter ir=400,jr=400integer is(0:ir+1,0:jr+1),tmax,isn(1:8),nstate,t,nr,is0,iy0,ix,jy integer is1(0:ir+1,0:jr+1),isn1(1:8)write(*,*)"please input the time step"read(*,*)tmaxiseed=rtc()irc=ir/2jrc=jr/2is=10is(irc,jrc)=1is1=isopen(1,file="F:\089024352si.dat")do t=1,tmaxis=is1do ix=1,irdo jy=1,jrisn=(/is(ix-1,jy-1),is(ix-1,jy),is(ix-1,jy+1),is(ix,jy-1),! is(ix,jy+1),is(ix+1,jy-1),is(ix+1,jy),is(ix+1,jy+1)/)e0=count(isn.ne.is(ix,jy))nr=8*ran(iseed)+1nstate=isn(nr)e=count(isn.ne.nstate)rd=ran(iseed)ig=nstate-is(ix,jy)de=e-e0+ig+2.5*rd-1.25if(de.lt.0.0)is1(ix,jy)=nstateend doend dodo ix=1,irdo jy=1,jrif(mod(t,20).eq.0)thenisn1=(/is1(ix-1,jy-1),is1(ix-1,jy),is1(ix-1,jy+1),is1(ix,jy-1),! is1(ix,jy+1),is1(ix+1,jy-1),is1(ix+1,jy),is1(ix+1,jy+1)/) isre=setcolor(is(ix,jy))if(count(isn1.ne.is1(ix,jy)).gt.0)isre=setcolor(15)isre=setpixel(ix,jy)end ifend doend dowrite(1,*)t,sqrt(1.0*count(is.eq.1))end doclose(1)end!CA多晶长大use msflibparameter ir=400,jr=400,nmax=100integer is(0:ir+1,0:jr+1),tmax,isn(1:8),nstate,t,nr,is0,iy0,ix,jy integer igv(0:nmax)integer is1(0:ir+1,0:jr+1),isn1(1:8)write(*,*)"please input the time step"read(*,*)tmaxiseed=rtc()igv=1igv(0)=10do i=1,nmaxix0=ir*ran(iseed)+1jy0=jr*ran(iseed)+1if(is(ix0,jy0).ne.0)cycleis(ix0,jy0)=iend dois1=isopen(1,file="F:\089024352wu.dat")do t=1,tmaxis=is1is(0,0:jr+1)=is(ir,0:jr+1)is(ir+1,0:jr+1)=is(1,0:jr+1)is(0:ir+1,0)=is(0:ir+1,jr)is(0:ir+1,jr+1)=is(0:ir+1,1)do ix=1,irdo jy=1,jrisn=(/is(ix-1,jy-1),is(ix-1,jy),is(ix-1,jy+1),is(ix,jy-1),! is(ix,jy+1),is(ix+1,jy-1),is(ix+1,jy),is(ix+1,jy+1)/)e0=count(isn.ne.is(ix,jy))if(e0.eq.0)cyclenr=8*ran(iseed)+1nstate=isn(nr)e=count(isn.ne.nstate)rd=ran(iseed)ig=igv(nstate)-igv(is(ix,jy))de=e-e0+ig+2.5*rd-1.25if(de.lt.0.0)is1(ix,jy)=nstateend doend dodo ix=1,irdo jy=1,jrif(mod(t,20).eq.0)thenisn1=(/is1(ix-1,jy-1),is1(ix-1,jy),is1(ix-1,jy+1),is1(ix,jy-1),! is1(ix,jy+1),is1(ix+1,jy-1),is1(ix+1,jy),is1(ix+1,jy+1)/) isre=setcolor(mod(is(ix,jy),15))if(count(isn1.ne.is1(ix,jy)).gt.0) isre=setcolor(15)isre=setpixel(ix,jy)end ifend doend dowrite(1,*)t,sqrt(1.0*count(is.eq.1)) end doclose(1)end。