为什么C语言程序出现segmentfault怎么样atuin fault

在 SegmentFault,解决技术问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。
一线的工程师、著名开源项目的作者们,都在这里:
获取验证码
已有账号?
问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
打算学习php
编程语言需要先学C语言基础吗?
这个问题已被关闭,原因:偏离社区主题 - 与技术无关、讨论类、对他人无用
来源: 101 新手上路
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
C作为入门语言,其原因是C比较接近底层,又有一定的抽象性,学习它虽然将来未必会使用它,但可以更了解计算机原理以及数据结构。可能对于大多数程序员来说没太大用处,但原理和数据结构可以让你能以计算机角度来思考程序问题,写出更高效的代码。这算是专业的程序员的一种修为。而且C现在还是主流,它是那么的经久不衰,作为入门语言是很适合的。但C的中文教材要选好,大学的C语言教材比较难懂。
如果你并不打算很深入程序设计领域,那么python、ruby会是不错的选择,它们更偏向于抽象,不必理会计算机原理,会让你对程序设计更有兴趣。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
打算学PHP就直接学PHP,如果不打算做系统底层、深入底层的话,学C的性价比不高。
在用PHP的时候,只有遇到一些比较深入的问题才知道C。但是学C也是有好处的。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
个人建议不要从c开始。另外你要学习的语言是php,一门动态语言。而c语言是一门静态语言。他们之间的差别和基本理念还是有很大差别的。所以不建议你从c开始。而是直接从php入手。那样你能学习的更快一些。当你什么时候发现需要使用c的时候再去学也不迟!
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
可以考虑从函数式语言入门,也许会有另一番体会
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
不需要,但是需要HTML+css+js的基础,理解面向对象时可以顺带学java的相关内容加深理解,再往后学Mysql等数据库,做项目,进而模板框架。。。学完这些你发现好像和C没关系,,不过这已经让你入门PHP了,再往深处学,我也没学到那个程度,不知道需不需要C。。你学到了告我哦
附一个学习路线:
仅供参考。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
建议学python应用面比php更广
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
非常建议你学习python.入门学习?你可以在1个月之内,看完这3本书:
都是非常入门的书籍,而且会让你产生很大的兴趣。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
不需要,如果只是做Web开发,C语言不需要学。
因为关注的焦点不一样。
倒是更需要关心下HTTP协议,TCP/IP协议。
只有当你觉得PHP只是一个语言工具的时候,
可以深入进去看看,
研究下C也是未尝不可的。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
这个就看你个人的发展了,如果只是单程的从事web这一块领域,且不想深入理解其实现原理的话就可以不用学c,毕竟很多东西都是从c发展过来的,了解学习c会给你一个更加清晰明确的思路! 所以这个就看个人需求了`!
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
从其他高级语言往底层学习也是可以的,就看你的毅力了、。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
赞同@ruin52xl的答案 -- 学什么,要看你想干什么,未来的发展方向是什么。
如果只是想搞搞网页,搞搞前台,直接学PHP更快,更省心;
如果搞运维方面的,或许perl、python更适合……
我记得有个图,可以更直观地去判断:
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
个人觉得不懂c的程序员就不是完整的程序员。c语言知识应该达到过国家二级的水平(这根本不是个坎),就是语法加逻辑。在有一点基础的情况下再去学高级语言,脚本语言,会相对顺利些
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
主要看你学习编程要做什么。不同的语言注重不同的领域。如果要学习Web开发先学习PHP足以,熟练使用PHP后、有足够的时间想了解低层的东西,如优化PHP性能可以再学习C;
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
我感觉没有啥入门之说。我学的第一门语言(除了html/css)是javascript,并不是要用js来入门,而是当时需要用js。我不是计算机专业的,完全出于兴趣自学。啃js的时候,不是想象中的困难。后面学C#的时候比较吃力。再到php就如鱼得水了,后来研究java也得心应手...
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
对于零基础的朋友学起来难度就在于什么也不懂看到代码就蒙,所以对于零基础的朋友还是建议多练,多看待着疑问去练 给大家分享一个适合零基础的资料 可以看看 跟弹窗的人工要
该答案已被忽略,原因:
这个问题已经被关闭无法回答
分享到微博?
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:Access denied |
used Cloudflare to restrict access
Please enable cookies.
What happened?
The owner of this website () has banned your access based on your browser's signature (3b682b-ua98).在 SegmentFault,解决技术问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。
一线的工程师、著名开源项目的作者们,都在这里:
获取验证码
已有账号?
标签:至少1个,最多5个
号(Single Day~~~)
C语言,在今天来说是一种特殊的编程语言。只有极少数人真的可以用C进行编程,而且我们中很大一部分人都对C有自己的看法。缓冲区溢出,栈溢出,整型数据溢出,C有很多广为人知缺陷,而这些缺陷被人们随意传播,甚至那些不熟悉C的人们。我自己已经有10念没有接触C了,由于这样或那样的原因。开始的额时候,编译器是很昂贵的(在免费的UNIX被发布之前)而且很慢,那时的环境是很糟的。而且,所有关于C的恐怖故事让我觉得我这么一个小小的普通程序员怎么可以写出可靠的C程序。
撇过一些我直接从别的地方复制粘贴过来的很多小的C模块不说,我自己写的第一个C程序是 VM。其中有两件事情让我惊呆了:-o 。第一,写C程序原来不是那么难。事后我才知道我年轻的时候浪费时间写汇编代码这件事在心理上给我了很大的支持,毕竟C是高级一点的汇编语言。一旦一个人理解了像指针(可以说是低级语言中最微妙的概念,因为真实世界中没有相对应的比喻)这样的概念。第二件事情是,Converge VM没有像我期待那样满是bug。
实际上,忽略可能在任何编程语言上都存在的逻辑错误,到目前为止在Converge VM中引发实际问题的只有两个只针对C才会有的错误(主意,我肯定还有很多潜伏的bug,但是我情形还没有碰上太多)。第一个错误是,一个list没有以\0(C中经典的错误),这个问题花了很长时间去调试。另一个错误则神奇的多了,花了我好几个月时间。Converge 垃圾回收器可以谨慎地根据指针回收随意分配的内存空间。在所有的现在结构中,指针都指的是字和字对齐的边界。然而,已经分配的内存块在长度上常常不是字和字对齐的。 (In all modern architectures, pointers have to live on word-aligned boundaries.However, malloc'd chunks of memory are often not word-aligned in length.) 所以有时候垃圾回收器会在一个内存块位置为4的地方尝试读取4bytes,即使那个内存块是5bytes长。换句话来说,垃圾回收器尝试读入一块数据的1bytes和内存中理论上没有权限的3bytes随机数据。罕见和神奇的是,这导致的错误几乎没法解释。但是不夸张的说,在多少编程语言中一个人可以递归地加上垃圾回收器?
我和Converge VM的经历不怎么不符合我之前的偏见。我已经慢慢承认C程序会随机出现segfault,丢数据,而且常常会像Vikings(维京海盗)去Lindisfarne一样。对比来看,用高级语言编写的程序会按照正常逻辑和可以预料的模式报错。渐渐地,这些问题在我日常使用的我可以信任的这些用C写的程序中,我都碰到了。我不记得上次这些程序发生大问题的时候了。这些不会崩溃,也会优雅的处理次要的错误。就算,我对这些软件(我使用OpenBSD9年了,所以没有比这些质量更好的软件了)极度挑剔,还有一些明显的原因以至于为什么它为什么如此可靠:它被很多人使用,而这些人帮助我们找出bug。软件已经被开发出来很长时间了,所以之前的版本都存在bug。并且,坦诚一点,只有相当能干的程序员首选会倾向于C。但是,仍然存在一个根本的问题:为什么用C写的程序坚如磐石?
过了写论文这段黑暗的时期之后,我最近做了一点C编程。对于长时间没有着手写C程序的人,想妥妥地发封邮件都没谱了。这些年,我都是通过ssh在远程机器用sendmail发送邮件的。这解决了很多问题(比如黑名单),在很多网络中它也有问题(尤其是无线网络),一个过多的网络连接会被抛掉。检查邮件是否发送是很烦人的过程。所以仔细检查它的设计后,我打算写一个简单的工具集来稳妥地通过ssh发送邮件。最终的程序 -
- 比我之前所期待的有更多的功能,但是最基础的思想就是通过外部的命令比如ssh简单的重试发送邮件,直到成功发送。我还想让这个工具集尽可能占用资源少还实用,还可移植。这必然决定应该用C写extsmail。然后我决定尝试尽可能地写这个程序,就当是实验吧。用传统的UNIX方式,只依赖可靠的UNIX分发版所提供的功能,而且容错能力强。在做的过程中,做了两份关于用C写程序的新手观察资料。
第一个观察不是太明显。因为用C写的程序有无数多种错误方式,我比平时更加细心。特别的,任何内存块的的操作都会引发非常危险的缓冲溢出类型错误。然而,在一个高级语言中,我可能会比较懒,心想“嗯,我索引数组的时候是不是应该给这个值减一?先跑一遍看看”。在C中,我会想“OK,坐下来想想原因”。讽刺的是,跑程序和发现问题所花的时间和坐下来思考的时间是不一样的,除了坐下来思考更加耗费脑力。
第二个观察,是我之前从没有碰到过的,在C中没有异常处理。如果,比如说extsmail,要提高容错能力,就得自己不得不处理所有可能的错误。从一方面来说,这是非常痛苦的,extsmail有很大一部分比例(大概40%)都在检查和去除错误,虽然UNIX系统方法已经很仔细的处理出错的情况了。换句话说,当在C中调用一个方法,比如stat的时候,文档会列出所有失败的情况。用户可以很容易的选择应该在程序中修复哪个情况,哪些致命错误应该进一步处理(在extsmail中,内存不足就是致命错误)。这就是在思维模式上基于语言的异常处理方式巨大的不同点,经典的哲学是正常地写代码,仅在少数情况下写try ... catch语句块来处理特定错误(很少碰到的错误)。Java,用受控制的异常,以不同的方式告诉用户“当调用这个方法的时候,你需要try catch特定的异常”。
我明白了一件事情,当希望软件足够的强壮(鲁棒性)的时候,基于异常的软件设计是不合适的。而需要明确的是知道一个方法返回的或者抛出的错误或者异常,然后根据情况去处理。在现在的IDE中,可以根据写的方法自动显示会抛出哪些异常,最多也就只能做到这一点了。理论上,面向对象中的子类和多态意味着预编译的库不能根据写的代码确定会不会抛异常(因为子类会重写方法,会抛出不同的错误)。从实用方面来说,我怀疑这么多方法都会抛出很多不同的异常,这会让用户懵了。对比UNIX中的方法,就非常注意,它们会尽量减少返回给用户的错误的数量,和一些内部错误,或者收集归类错误。进一步,我也怀疑那些依赖异常处理的很多库需要大幅度的进行重写来减少抛出的异常数量直到一个合理的数值。再进一步,方法的调用者应该决定什么错误应该次要的,可以恢复的,哪些会导致重要的问题,甚至导致程序结束;受控制的异常,被调用者强制处理的异常,就忘了这一点。
Henry Spencer 说,“那些不懂UNIX的人注定要可怜地重新发明轮子”。这就是为什么这么多用C写的程序比我们所提出的偏见更加坚固,UNIX文化,在计算机主流里,最古老和最明智的文化,已经发现很多把C的局限和缺陷变成优势的方法。就像我经历的,慢慢地我才明白了这点。综上,如果没有经过大量的思考,我不建议使用C。如果使用C,那最终的软件坚如磐石,但开发会花费大量人力。
2 收藏&&|&&1
你可能感兴趣的文章
4 收藏,480
12 收藏,1.7k
分享到微博?
我要该,理由是:关于C语言的Segment fault的问题? - 知乎3被浏览534分享邀请回答List[i] & List[j]
而不是列表的 [1,2], [2,3], [3,4], [4,5] ... 项对比。(Fis1-&data)&(Sec1-&data)
你的算法的复杂度是而不是。所以你的算法里面的Fis1=Fis1-&
Sec1=Sec1-&
直接在突破个元素之后指向了未知的内存区域,因此运行的时候报错 Segment Fault。0添加评论分享收藏感谢收起11 条评论分享收藏感谢收起GModel;IJGGC-391;No.ofPages17;ARTICLEINPRESSInternatio;Contentslistsavailableat;InternationalJournalofGr;journalhomepage:www.else;CO2captureincoal-?redpow;R.Strube?,G.Manfrida;Depa
G ModelIJGGC-391;No.ofPages17ARTICLE IN PRESSInternationalJournalofGreenhouseGasControlxxx(2011)xxxCxxxContentslistsavailableatScienceDirectInternationalJournalofGreenhouseGasControljournalhomepage:/locate/ijggcCO2captureincoal-?redpowerplants―ImpactonplantperformanceR.Strube?,G.ManfridaDepartmentofEnergyEngineering“SergioStecco”,UniversityofFlorence,50134Florence,ItalyarticleinfoabstractInordertoreduceCO2emissionsfromapowerplant,CO2caneitherbecapturedfromthe?uegasesorfromthesyngasstreaminagasi?cationplant.Inthispaper,theauthorscomparetheeffectofCO2captureonpowerplantperformanceforapulverisedcoalpowerplantwithpost-combustionCO2capture,anIntegratedGasi?cationCombinedCycle(IGCC)witheitherseparateorco-captureofCO2andH2S,aswellasanoxy-fuelpowerplantwithcryogenicCO2puri?cation.Thehighestimpactonpowerplantperformanceisobservedforpost-combustioncapture,whileCO2puri?cationinoxy-fuelcombustionhasthelowestspeci?cenergypenaltyforCO2captureofallinvestigatedoptions.AllprocessesweresimulatedwithAspenPlus.?2011ElsevierLtd.Allrightsreserved.Articlehistory:Received15September2010Receivedinrevisedform19January2011Accepted23January2011AvailableonlinexxxKeywords:MEAAmmoniaPost-combustionPre-combustionOxy-fuelCO2capture1.IntroductionThestillrisingdemandforenergyandtheincreaseinCO2emissionstypicallyinvolvedhavebecomethemostimportantenvi-ronmentaltopics.Coalisaresourcestillreadilyavailable.Itsuseinpowergenerationcomeswithacost,however,sinceitscom-bustionreleasesahighamountofCO2.In2006,41%oftheglobalelectricitywasproducedwithcoalasfuel.Evenifthispercentageistohalfdownto21?cordingtothe450ppmCO2mitigationscenariooftheIEA,coalwillremainoneoftheprincipalsourcesforelectricitygeneration(IEA-GHG,2009).Inordertoreducetheenvironmentalimpactofpowergenerationfromfossilfuels,CO2canbecapturedeitherfromasyngasstreamorfromthe?uegasesexitingtheenergyconversionprocess.AcomprehensiveoverviewonthedevelopmentsinCO2captureandstoragetechnologycanbefoundintheliterature(Maroto-Valer,2010).Inthispaper,theauthorscomparetheeffectofCO2captureonpowerplantperformanceof(i)a500MWpulverisedcoalpowerplantusingmonoethanolamine(MEA)andammoniaaschemicalsolventsforpost-combustionCO2capture,(ii)a500MWInternalGasi?cationCombinedCycle(IGCC)withthephysicalsolventforeitherseparateorco-captureofCO2andH2S,and(iii)a500MWoxy-fuelpowerplantwithcryogenicCO2puri?ca-tion.Post-combustioncapturehastheadvantagethatitcanbeappliedtoretro?texistingpowerplants.Thisisnotthecaseforpre-combustionCO2capture.However,IGCCplants,towhichthiscapturetechnologyisapplied,usuallyshowahigherenergyef?-ciency.Duetotheelevatedpressureofthegasstream,physicalsolventscanbeusedherefortheremovalofacidgascomponents.Inanoxy-fuelpowerplantthefuelisburnedwithoxygenpro-videdbyanairseparationunit(ASU).FromtheresultinghighlyconcentratedCO2?uegasstreamtheimpuritiesandinertshavetobeseparated.Theenergyintensiveairseparationintroducesahighpenaltythough.ForNGCCprocesses,asimilarstudyhasbeenperformedattheNTNU(BollandandUndrum,2003).2.ProcesssimulationsPowerplantprocesseswithandwithoutcaptureweremod-elledwiththe?owsheetsimulationprogramAspenPlus?(Aspen,2008b),whichhasbecomeawidelyusedstandardapplicationforcomputerized?owsheetsimulationsinthechemicalindustry.AcomparisonofequilibriumbasedandofratebasedsimulationswascarriedoutforthechemicalabsorptionofCO2inpost-combustioncapturetoverifytheimportanceofkineticsonthisprocess.Althoughnoin?uenceofkineticswasfoundforthephys-icalCO2absorptioninpre-combustioncaptureandintheoxy-fuelCO2puri?cation,ratebasedcolumnmodelswereusedtheretoobtainresultsforthenecessaryheightofthenecessaryinstalla-tions.?Correspondingauthor.Tel.:+;fax:+.E-mailaddresses:(R.Strube),manfrida@uni?.it(G.Manfrida)./$Cseefrontmatter?2011ElsevierLtd.Allrightsreserved.doi:10.1016/j.ijggc.Pleasecitethisarticleinpressas:Strube,R.,Manfrida,G.,CO2captureincoal-?redpowerplants―Impactonplantperformance.Int.J.GreenhouseGasControl(2011),doi:10.1016/j.ijggc.G ModelIJGGC-391;No.ofPages172Table1PCpowerplantparameters.CoalfeedHeatingvaluecoalHPTurbineIPTurbineLPTurbineCondenserAmmoniaforSCRLimestoneslurryforFGDFluegas?owrateFluegaspressureandtemp.FluegasCO2concentrationARTICLE IN PRESSR.Strube,G.Manfrida/InternationalJournalofGreenhouseGasControlxxx(2011)xxxCxxx50.4kg/sHHV=27.06MJ/kg,LHV=25.87MJ/kgTin=533?Cpin=152barpin=42.5barpin=4.67barpcond=0.04bar1.436kg/s20.548kg/s(6.74wt.%),1.871kg/sgypsumproduced604.8kg/s1.013bar,120?C0.131P=130.7MWelP=190.1MWelP=243.7MWelQcooling=265MWth2.1.Post-combustionCO2captureMostanthropogenicpointsourcesofCO2arecombustionsys-temssuchaspowerplants,cementkilnsandfurnacesasusedforironandsteelproduction,wherethefuelisburnedwithair.Post-combustioncaptureistheremovalofgreenhousegasesattheendoftheconversionprocess.Therefore,thiscapturemethoddiscussedinthefollowingisaveryimportantprocessforreducingCO2emis-sions.Sincethesecombustionprocessesareoflargescale,occuratlowpressureandduetothelargenitrogencontentofair,theypro-duceverylargegas?owswithalowcontentofCO2.Thiscontentrangesfrom3vol.%foraNaturalGasCombinedCycle(NGCC)toabout15vol.%foraconventionalcoal-?redpowerplant.DuetothelowpartialpressureofCO2inthegasstream,liquidseparationisapossiblecandidate.Chemicalsolventabsorptioniscurrentlythemostpromisingandcost-effectivetechnologyforpost-combustionCO2capture(IEA-GHG,2006).ImpuritiessuchasSOX,NOX,particulates,HCl,HF,metals(mercury,etc.)andothercontaminantsmaynegativelyaffectcap-tureperformancebycausingsolventdegradation.Especiallythemostwidelyusedsolventmonoethanolamine(MEA)ispronetodegradation(YehandBai,1999),whichiscausedbyoxygenandoxygen-containingcomponentssuchasNOXandSOX,byproduc-ingoxidisedaminefragments,NH3,formate,acetateandperoxides(Goffetal.,2003;SextonandRochelle,2009).Inthepresenceofoxygen,SO2dissolvedinMEAreactsveryquicklytoformheatstablesulphatesthathavetoberemovedtomaintainsolventper-formance(SextonandRochelle,2009).NOXiseasilydissolvedinwaterformingcorrosiveacids,andlikeSO2itcanreactirreversiblywithalkanolamines(Tanthapanichakoonetal.,2003;Wilsonetal.,2004),causingacontinuouslossofsolvent(IEA-GHG,2006).There-fore,thesecomponentshavetoberemovedtoverylowlevelsinthe?uegaspriortoenteringtheabsorptionsection(IEA-GHG,2007).AlthoughnewaminessuchasKS-1withverylowdegradationarebeingdeveloped,MEAisstillthemostwidelyusedsolventforCO2capture.Ithasveryhighreactivity,lowsolventcost,reasonablethermalstabilityandthermaldegradationrate(IEA-GHG,2007).ThechemicallycapturedCO2isreleasedbythermalsolventregenerationinastrippercolumn,whereaftertheCO2iscom-pressedfortransportandstorage.Heatforsolventregenerationisgenerallysuppliedbylow-pressuresteam,leadingtothemainenergypenaltyforCO2capture.Thenecessaryreboilerdutydependsstronglyonleansolventloading(Alie,2004;Alieetal.,2005;Abu-Zahraetal.,2007).Beingthemostin?uentialfactoronpowerplantoutput,thereboilerdutycanbeusedasavariableforoverallplantef?ciency.Post-combustioncaptureandpowerplantperformancearecomparedforchemicalabsorptionofCO2withMEAandwithammonia,sinceseveraldifferentstudiesshowedthattheuseofammoniaassolventmayleadtoasigni?cantreductionofupto62%inregenerationenergy(YehandPennline,2004;Yehetal.,2005).AlstomiscarryingoutstudiesonapilotplantatthePleas-antPrairiecoal-?redpowerplantbyWeEnergiesinKinosha,WI,USA(Modern-Power-Systems,2006;RhudyandBlack,2007;Kozaketal.,2009)andclaimthatthisprocessusesonlyabout50%oftheenergyneededforacomparableMEAprocess,leadingtoanoutputreductionofonly10%inthepowerplant.AmmoniacanalsobeusedforthesimultaneousremovalofCO2,SO2,andNOX(Resniketal.,2004).However,oneofthemajordrawbacksofthisprocessisthehighlossofammoniaduetoitshighvolatilityandtheformationofprecipitates(Daveetal.,2009).NH3hasfrequentlybeenusedasreactantfortheDe-NOXprocessinpowerplants,anditisalsointerestingfortheremovalofSO2andHClfrom?uegases(Resniketal.,2004).InorderforthesimulationsofCO2capturetobemorerealistic,thekineticsofabsorptionhastobetakenintoaccount.Withreac-tionkinetics,equipmentsizingbecomesafactoraswell.Withouttheinclusionofinformationontheabsorptionrate,themaximumabsorptioncorrespondingtotheequilibriumconditionsisachievedinstantly.Thisidealizationofthecaptureprocesswouldalwaysresultintheminimumsolvent?owandthustheleastenergypenaltyandequipmentsizenecessaryforthecaptureoperation.Inthisstudy,theperformancesofMEAandammoniaattwodif-ferentsolventtemperatureswerecomparedwithrespecttotheirperformanceassolventforCO2capture.Bothsolventsarether-mallyregeneratedinastrippercolumn.Extracarehasbeentakentoreducesolventemissionstotheenvironment(StrubeandManfrida,2009;Strubeetal.,2009).2.1.1.PulverisedcoalpowerplantForallpost-combustioncaptureprocessesthe?uegasstreamwasassumedtoexitfroma500MWelpulverisedcoalpowerplantwithaSelectiveCatalyticReduction(SCR)reactorfortheremovalofNOXwithammoniainjectionandwet?uegasdesulphurisation.Tothisplantthecapturesectionwasaddedandintegratedwiththesteamcyclefortheextractionofsteamtoprovideheattothestrippercolumns.AccordingtotheIEAreportonCO2capture(IEA-GHG,2006),NOXandSOXlevelshavetobereducedtoatleast20ppmand10ppm,respectively,topreventMEAdegradation.Withammonia,thesecontaminantscanbecapturedbythesolvent.However,theywouldendupintheseparatedCO2stream,wheretheymayhavetoberemovedtopreventequipmentdamageduetoacidforma-tion.Forthermalsolventregenerationinastrippercolumnsteamisextractedafterthemediumpressureturbines.TherelevantparametersofthistypicalRankinecyclepowerplant(Alie,2004)canbefoundinTable1.ThePengCRobinsonequa-tionofstate(EOS)wasusedforthisprocess,asrecommendedforthemodellingofcombustionprocesses.2.1.2.Post-combustionCO2capturesimulationswithammoniaAlthoughammoniahasahighloadingcapacity,thekineticsofCO2absorptionisrelativelyslow.ThereactionsforCO2absorptionwithammonia(Aspen,2008c)arelistedinTables2and3.Duetothepresenceofionicspecies,theelectrolyteNon-RandomTwoLiquid(NRTL)activitycoef?cientmodelisusedforPleasecitethisarticleinpressas:Strube,R.,Manfrida,G.,CO2captureincoal-?redpowerplants―Impactonplantperformance.Int.J.GreenhouseGasControl(2011),doi:10.1016/j.ijggc.G ModelIJGGC-391;No.ofPages17ARTICLE IN PRESSR.Strube,G.Manfrida/InternationalJournalofGreenhouseGasControlxxx(2011)xxxCxxx3A132.216.049?1.257?4.583?914.008B?92.1?5..2C?22.6?35.6.175DTable2EquilibriumconstantsforabsorptionwithNH3.Reaction2H2O?H3O++OH?(1)(2)CO2+2H2O?H3O++HCO3?HCO3?+H2O?H3O++CO3?2(3)NH3+H2O?NH4++OH?(4)??NH3+HCO3?NH2COO+H2O(5)NH4HCO3←→NH4++HCO3?SALT?0.037057(6)lnK(T)=A+B/T+Cln(T)+DT,TinKelvin.theliquidphaseandtheRedlichCKwongequationofstateforthevapourphase.Fig.1showsthe?owsheetforthemodelledcaptureprocess.Thecleaned?uegaspassesthroughacoolerofcirculatingcoldwater,wherecontaminantssuchasHClandHFgetwashedout.Anotheradvantageistheremovalofexcesswateraswellasthereductionofthevolumeofthe?uegases,whichhelpssaveenergyforthe?uegasblower(notshowninFig.1).InordertosaveenergyforthecompressionofthecapturedCO2andforthereductionofammonialossesfromthedesorber,thestrippercolumnoperatesatahigherpressure(2bar).TheCO2richsolventgetspreheatedbythehotleansolventleavingthedesorber.Thisregeneratedsol-ventneedstobecooledfurthertotheoperatingtemperatureoftheabsorbercolumn.Beforere-enteringtheabsorber,lossesofwaterandammoniahavetobecompensatedfor.Ammonialeavingatthetopofbothcolumnsiswashedoutwithwaterinadditionalpackedcolumns.SincealsoCO2getswashedoutthisway,anotherdesorptionprocessisnecessarytoremoveit.Theremainingwatercontainingthedissolvedammoniahastobesenttofurthertreat-ment.Inthesimulationsitwasnotpossibletoseparateammoniaandwatertosatisfyinglevelsinastrippercolumn.Theenergynec-essaryforthiswatertreatmentisnotincludedinthisstudy.FourofthecaptureinstallationsasshowninFig.1arenecessaryfortheremovalofCO2fromthe?uegasstream.Intheratebasedsimulations,theabsorberheightswerelimitedto35m.Inordertoachievegoodabsorptionandtokeepammonialossestoaminimum,itisnecessarytomaintainalowtemperatureinsidetheabsorber.Therefore,intercoolingat80%fromthetopofthecolumnisnecessary.Thesolventalsoneedstobecooledbeforeenteringtheabsorber.Duetotheslowkineticsoftheabsorptionreactionswithammonia,theabsorbercolumnstillhastobeverytall.Withoutintercooling,usingatallerabsorbercolumndoesnotimproveabsorptionsuf?cientlyinthiscase,andtheabsorptionef?ciencyoftheprocessdropsfrom90%to80%withallotherparametersunchanged.Fortheintercooledabsorbercolumn,theabsorptionrateismaintainedhighalongamuchlargerpartofthecolumn.Therefore,theabsorberisusedmuchmoreef?ciently.Forammonia,solventperformanceimprovesatlowertemper-atures.Chilledammoniaasanoptionforpost-combustionCO2capturewaspatented(Gal,2006)in2006byAlstom.Alstompro-posesasolventtemperatureof1.7?C(Power-Magazine,2008).However,attheselowtemperaturescoolingthesolventandintercoolingtheabsorbercolumnleadtoaverysigni?cantenergypenalty.WethereforeinvestigatedanalternativeprocesswithaTable3RateconstantsforkineticreactionswithNH3.ReactionCO2+OH?→HCO3?(7a)??(7b)HCO3→CO2+OHNH3+CO2+H2O→NH2COO?+H3O+(8a)NH2COO?+H3O+→NH3+CO2+H2O(8b)Er=kTnexp?RTsolventtemperatureof20?C.Thenecessarysolvent?owhastobehigher,ofcourse,sincetheloadingcapacityofthesolventisloweratthistemperature.Thereisalsoanincreaseintherequirementsforsolventmakeup,wastewatertreatmentandaboveallforheatinputtothestrippercolumns.Forthischilledammoniaprocess(CAP),theCO2loadingoftheleanstreamshouldpreferablybeintherangeof0.33C0.67molofCO2/molofammonia,andfortherichstreambetween0.67and1mol/mol(Valentietal.,2009).Intherate-basedsimulationshere,valuesatthelowerendwerefound.Aleanloadingofaround0.32provedtoleadtothelowestenergypenalties.Intheequilibriumbasedsimulations,therichloadingofthesolventaftertheabsorberwasfoundtobemuchhigherthaninthekineticmodels.AhigherdesorberpressurereducesammonialossesandenergyrequirementsforthecompressionofthecapturedCO2,sincethepressureisraisedbypumpingtherichsolventandnotbygascom-pression.Apressureatthelowerendoftherecommendedrangewaschosenhereduetothenecessaryamountofmaterialfortheequipmenttowithstandhigherpressures.Inorderto?ndtheidealsolventconcentrationforthecaptureprocess,theauthorsinvestigatedthenecessarysolvent?owratetoachieveagivenCO2removalef?ciency.Withconstantleanload-ing,solvent?owwasvariedfordifferentsolventconcentrations.Itcouldbeobservedthatduetoelevatedlosses,absorptionef?-ciencyisnotimprovedforhighersolventconcentrations.Theidealammoniaconcentrationwasfoundtobearound7wt.%.ThekeyparametersandresultsofthecaptureinstallationswiththeammoniasolventarepresentedinTable4forthetwotemper-aturecases.Forcomparativereasons,equilibriumbasedsimulationswerecarriedout,asmanydataontheperformanceofsolventsforCO2captureinliteraturewereobtainedwithouttheinclusionofreac-tionkinetics.Inthesesimulations,thenecessarysolvent?owwasfoundtobeonlyathirdcomparedtotheratebasedsimulations,whereassolventlossesandtheresultingnecessarysolventmakeupwerehalvedbytheexclusionofkinetics.k4.32×171.35×20E(kJ/kmol)55,48,????i=1?(mol?fraci??i),TinKelvinNai2.1.3.Post-combustionCO2capturewithMEADuetoitshighermolecularmassMEAhasalowermassloadingcapacitythanammonia,whichmakesextensivewashingofthegasstreamsleavingtheabsorberanddesorbercolumnsunnecessary.Althoughafarlowermass?owofammoniaisnecessarytocap-turethesameamountofCO2,theammoniaconcentrationinthesolventislimitedduetoitshighvolatility.Therefore,onamolarbasisthecaptureef?cienciesofMEAandammoniaareverysimilar.However,theMEAsolventhastoberegeneratedathighertemper-atures.Inthesimulations,thein?uenceofcorrosioninhibitorswasnotincludedandMEAlossesduetocorrosionwereestimatedtobe1.5kg/tofCO2(Abu-Zahraetal.,2007).Intheratebasedsimulations,thenecessaryabsorberheightforthecaptureprocesswithMEAwasfoundtobe2C3timestheheightdeterminedbyPlazaetal.(2009).Alowerstripperallowsforhighertemperaturesthroughoutthecolumnandpreventsre-absorptionofthereleasedCO2intothesolvent.ForthesamereasoncondensedPleasecitethisarticleinpressas:Strube,R.,Manfrida,G.,CO2captureincoal-?redpowerplants―Impactonplantperformance.Int.J.GreenhouseGasControl(2011),doi:10.1016/j.ijggc.G ModelIJGGC-391;No.ofPages174ARTICLE IN PRESSR.Strube,G.Manfrida/InternationalJournalofGreenhouseGasControlxxx(2011)xxxCxxxFig.1.Flowsheetforrate-basedmodelofCO2removalwithammoniasolvent.liquidontopofthestripperisnotledbacktothestripperbut?owsdirectlybacktothewashingsectionontopoftheabsorber.There,theliquidalmostcompletelyabsorbstheMEAleavingwiththegasstreamandalsosupportstheoperationoftheabsorber.Incon-trast,Alie(2004)foundthenecessaryreboilerdutytodecreasewithincreasingstripperheight.AttheUniversityofTexasatAustin,amodelwasdevelopedthatisbasedonarigorousthermodynamicmodelbyHilliard(2008)andAboudheirkinetics(Aboudheiretal.,2003).Thiselectrolyte-NRTLmodelandvapourCliquidequilibrium(VLE)datathatwereadjustedtopilotplantdata(Plazaetal.,2009)areusedheretomodelthissystem.Itdiffersfrompreviousmodelsbyincludingadditionaldataonaminevapourpressure,enthalpiesofabsorption,heatcapacity,andspeciation.Toguaranteethermodynamicconsistency,GibbsfreeenergyandenthalpyvalueswithinAspenPluswereusedforthecalculationofchemicalequilibrium.ThereactionsinTable5wereusedforthisrate-basedmodelofCO2absorptionwithMEA(Plaza,2009).InFig.2theschematicdiagramoftheAspenPluscapturemodelwithMEAisshown.Table4KeyparametersforoneoffourCO2captureinstallations.NH3at1.7?CLeansolvent?owandconc.Gasinletandsolventtemp.LeanloadingRichloadingColumnpackingAbsorberparametersWashsectionofabsorberStripperparametersSolventmakeupWatermakeupWashwater?owandtemperatureChillingduty1336kg/s,7.1wt%.25?C,1.7?C0.318mol/mol0.493mol/molFlexipac1Y,80%?ooding1.1bar,35m,?10.7mC2bar,3m,?6.8m1.25kg/s4.45kg/s70kg/s,15?C?86.7MWthThekeyparametersandresultsofoneofthefournecessarycap-turesectionsarepresentedinTable4.Theyincludethecolumnsizesandsolventparameterssuchasloadings,lossesandrequiredmakeup.IntheworkofPlazaetal.,aleanloadingof0.4mol/molwasshowntopresenttheleastenergypenaltyinCO2capturewithMEA.Otherstudiesfoundaleanloadingof0.25mol/mol(Alie,2004)orof0.32mol/mol(Abu-Zahraetal.,2007)togivetheleastenergyrequirementsforsolventregeneration.Inagreementwithliter-ature,aleanloadingof0.3mol/molwasfoundinthisstudytogivetheminimumnecessaryreboilerdutyforsolventregenera-tion.However,ahydraulicandathermalanalysisoftheabsorberrevealedthat(i)moresolvent?owisnecessarytopreventliquidbeingcarriedoutatthetopoftheabsorberand(ii)thatother-wisestagetemperaturesabove76?Ccanbefound.Therefore,aleanloadingof0.4waschosenhere.Forgoodabsorption,itisnecessarytomaintainalowtemperatureinsidetheabsorber.Asolventandgasinlettemperatureof40?Cwasfoundtogivethebestresults.Inordertoachievethissolventtemperatureinsidetheabsorber,inter-coolingto40?CbycollectingthesolventandpassingitthroughaNH3at20?C1596kg/s,7.1wt.%?C,20?C0.313mol/mol0.450mol/molFlexipac1Y,80%?ooding1.1bar,35m,?11.2mC2bar,3m,?7.7m1.88kg/s6.26kg/s87kg/s,15?C?30.1MWthMEA1204kg/s,31wt.@?C,40?C0.400mol/mol0.513mol/molFlexipac1Y,80%?ooding1.1bar,18m,?10.2m4m,?6.4m1.6bar,4m,?6.6m0.224kg/hforlosses,161kg/hduetodegradation[9]0.32kg/sCCPleasecitethisarticleinpressas:Strube,R.,Manfrida,G.,CO2captureincoal-?redpowerplants―Impactonplantperformance.Int.J.GreenhouseGasControl(2011),doi:10.1016/j.ijggc.G ModelIJGGC-391;No.ofPages17ARTICLE IN PRESSR.Strube,G.Manfrida/InternationalJournalofGreenhouseGasControlxxx(2011)xxxCxxx5k4.734×E19,342kJ/kmol107,470kJ/kmol49,Table5RateconstantsforkineticreactionswithMEA.Reaction(9a)2MEA+CO2→MEAH++MEACOO?(9b)MEAH++MEACOO?→2MEA+CO2MEA+CO2+H2O→HCO3?+MEAH+(10a)HCO3?+MEAH+→MEA+CO2+H2O(10b)Er=kTnexp?RT??????(mol?fraci??i),TinKelvini=1Naiheatexchangerat80%fromthetopofthecolumnisnecessaryhereaswell.Higherconcentrationsthanca.40wt.%donotsigni?cantlyreducethenecessarysolvent?owrateforadesiredremovalef?-ciency.Ahighersolventconcentration,however,leadstoelevatedlossesofsolventwiththegasstreamfromtheabsorber.Thismakesitnecessarytoraisethe?owrateofthewashwaterstream,whichinturndilutesthesolvent.Acompromisesolventconcentrationwasfoundtobeintherangeof30C40wt.%.TheMEAconcentrationof31wt.%requireda10%highersolvent?owthanachievedwithasolventconcentrationof35wt.%.However,duetopossibledegra-dationissues,thislowersolventconcentrationwaschosenforthisstudy.Intheequilibriumbasedsimulations,solventlosseswerefoundtobefourtimeshigherthanintheratebasedsimulationsatasimilarnecessarysolvent?owtoachieveacapturerateof90%.2.1.4.In?uenceofCO2captureoptionsonpowerplantInpowerplantswithpost-combustioncaptureitisimportanttoalsoconsiderprocesschangesnecessaryforthesolventstofunctionproperly.Forexample,NOXandSOXlevelshavetobereducedtoverylowlevels(IEA-GHG,2006)upstreamoftheCO2capturesec-tioninordertopreventMEAdegradation.This,however,introducesanadditionalenergypenaltytothepowerplant.Withammonia,thesecontaminantscanbecapturedbythesolvent(Yehetal.,2005).TheywouldeventuallyendupintheseparatedCO2stream,however,wheretheymayhavetoberemovedtopreventequip-mentdamageduetoacidformation.Theamountoftheammoniasalts(NH4)2SO4andNH4HCO3thatprecipitateunderrealisticcon-ditionsinthechilledammoniaprocessremainstobeinvestigated.Thesesaltscouldbeusedforfertilizerproduction(Pellegrinietal.,2009).However,alloptionsstudiedhereassumethesameamountof?uegasdesulphurisationanddenitri?cationpriortoCO2captureandinthepowerplantwithoutCO2capture.DataforpurityandoxygenconcentrationoftheCO2streamsleavingthecapturesec-tionswiththesolventsMEAandammoniaatthetwoinvestigatedsolventtemperaturesarealsopresentedinTable4.CO2capturewithMEAleadstoagreaterpurityoftheCO2stream.Highertemperaturesinthecaptureprocessleadtoareducedabsorptionofthelightergascomponentsandthustoalowerconcentrationofthesecomponentsinthecapturedstream.Thechoiceofthedifferentcapturecon?gurationsleadstodiffer-entimpactsonthepowerplant,mainlyduetothedifferenceintheenergyrequirementsforsolventregenerationinastrippercolumn,forwhichsteamisextractedafterthemediumpressureturbines.ThemainparametersforpowerplantperformancewithoutCO2captureandforaCO2removalef?ciencyof90%arepresentedinTable6.ThedataforCO2capturewithammoniaincludetheparam-Fig.2.Flowsheetforrate-basedmodelofCO2removalwithMEA.Pleasecitethisarticleinpressas:Strube,R.,Manfrida,G.,CO2captureincoal-?redpowerplants―Impactonplantperformance.Int.J.GreenhouseGasControl(2011),doi:10.1016/j.ijggc.三亿文库包含各类专业文献、高等教育、外语学习资料、文学作品欣赏、各类资格考试、专业论文、行业资料、coal-fired power plants―Impact on plant performance56等内容。 
 reliance on coal increased throughout the country, the reliance on coal ...coal-fired power plant, have also made such plants less attractive from a...  Beijing closes coal power plant to cut pollution Beijing on Friday closed a...There were once four major coal-fired power plants in Beijing. The first ...  长春师范大学 学术毕业论文 本科生 火电厂关于烟气脱硫脱硝技术的研究 Research of Coal-fired power plants on flue gas desulfurization denitration technology 李达...  coal-fired power plant, have also made such plants less attractive from a...The influence of the mother on the offspring, statistics, is represented by...  Near Zero Emission Coal fired power plants (NZEC...When CCS is utilized in the CTL plant, the ...including the impact from charging EV on electricity...  Computer readouts from the testing enables plant ...of fly ash from coal-fired power plants. Carbon...impact on the environment (do less harm), ...  power production mainly rely on to coal as the ...impact assessment of coal-fired power plants in ...key words: thermal power plant, coal, ...  abstract: for coal-fired power plants, coal ...power plant safety and economy, very different ...the impact of coal quality on the unit output,...}

我要回帖

更多关于 segmentfault怎么样 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信