Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新
    1. Home
    2. 星星星星晴
    星
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups

    星星星星晴

    @星星星星晴

    265
    Posts
    877
    Profile views
    7
    Followers
    4
    Following
    Joined Last Online

    星星星星晴 Follow

    Best posts made by 星星星星晴

    • RE: 将2.3版本中自带的kOmega模型改名字后单独编译报错?

      我没用过2.3 不过一般情况下自己改模型的标准流程是:

      1. copy
      2. 修改文件内模型命名,用sed -i可以批量修改,比如原来叫kOmega,你现在可以改为MykOmega,注意看看是不是所有的class都改了,是不是有的地方不应该改,然后sed就给你全局 修改了?
      3. 修改Make中的files和option
      files中注意你的目标文件名是否已经修改为心的 .C文件
      sprayFoamTest.C//原来是sprayFoam
      //是否输出到你的USER_LIBBIN,
      //而且有一个心的命名,如果成功编译在你的USER_APPBIN中会出现一个新的文件,以你设置的下面的名字命名,例如我的就是sprayFoamTest
      EXE = $(FOAM_USER_APPBIN)/sprayFoamTest
      
      
      首行添加引用的地方
      LIB_USER_SRC = $(WM_PROJECT_USER_DIR)/src
      
      EXE_INC = \
          -I. \
          -I../reactingParcelFoam \
          -I$(LIB_SRC)/finiteVolume/lnInclude \
          -I${LIB_SRC}/meshTools/lnInclude \
          -I${LIB_SRC}/sampling/lnInclude \
          -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
          -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
          -I$(LIB_USER_SRC)/lagrangian/basic/lnInclude \
          -I$(LIB_USER_SRC)/lagrangian/intermediate/lnInclude \
          -I$(LIB_USER_SRC)/lagrangian/spray/lnInclude \
          -I$(LIB_USER_SRC)/lagrangian/distributionModels/lnInclude \
          -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
          -I$(LIB_SRC)/transportModels/compressible/lnInclude \
          -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
          -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
          -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
          -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
          -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
          -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
          -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
          -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
          -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
          -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
          -I$(LIB_SRC)/ODE/lnInclude \
          -I$(LIB_SRC)/regionModels/regionModel/lnInclude \
          -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
          -I$(LIB_SRC)/combustionModels/lnInclude
      
      EXE_LIBS = \
          -L$(FOAM_USER_LIBBIN) \ //这个地方也别忘了添加,有可能编译的时候找不到改位置 如果不设置的话
          -lturbulenceModels \
          -lcompressibleTurbulenceModels \
          -llagrangian \
          -llagrangianIntermediate \
          -llagrangianTurbulence \
          -llagrangianSpraytest \  //这边要引用你自己修改的模型的名称
          -lspecie \
          -lcompressibleTransportModels \
          -lfluidThermophysicalModels \
          -lliquidProperties \
          -lliquidMixtureProperties \
          -lsolidProperties \
          -lsolidMixtureProperties \
          -lthermophysicalFunctions \
          -lreactionThermophysicalModels \
          -lSLGThermo \
          -lchemistryModel \
          -lradiationModels \
          -lODE \
          -lregionModels \
          -lsurfaceFilmModels \
          -lcombustionModels \
          -lfiniteVolume \
          -lfvOptions \
          -lmeshTools \
          -lsampling
      

      希望能帮到你

      posted in OpenFOAM
      星
      星星星星晴
    • 【分享+搬运】自定义非均匀inlet U

      有条件的可以自行油管:https://www.youtube.com/watch?v=K-nAF3qAPTc
      感谢youtuber:Mark Kimber
      侵删

      1. 首先你要有一个自己的进口速度场的公式

        0_1545211435195_151b6040-02bc-4564-b234-278bda56300f-image.png

        或者自行拟合一个,根据实际情况来。

        0_1545211492714_342c9ffa-58c9-4586-a02d-c67091a23998-image.png

      2. 在Terminal中输入

        writeCellCentres
        

        获取网格每个cell的坐标,会生成ccx,ccy,ccz三个文件,内涵每个patch中的每个cell的坐标(x,y,z),找到inlet patch,我的是topWall。3个文件中的topwall(就是我的inlet)的2100代表的是这个patch上又2100个网格。同理对于ccy文件同样找到这个patch的所有cell坐标。分别复制这些数据,生成两个新的文本,叫inletX, inletY。根据实际网格情况,以及坐标轴自行选择用哪2个文件。

        0_1545211861236_d4842d0a-141a-4d61-ba47-720c64fbded6-image.png
        0_1545212222778_b5c53c18-efcc-4912-b38e-f0298d2a48a0-image.png

      3. 进入octave(一个类似matlab的程序,youtuber是这么说的)这一步主要是根据你的速度场的公式,xy坐标,计算出进口的vector。
        0_1545212556614_ba95eede-affa-46b6-8d20-5754edb8bdf5-image.png

        x= load('inletX');   //读取inlet patch的x坐标
        y=load('inletY');    //读取inlet patch的y坐标
        Uz==1.1+0.18988/0.01415/sqrt(3.1415926/2)*exp(-2*(x.^2+y.^2)/0.1415.^2);  //公式
        fid= fopen('inletU','w')// inletU文件要提前新建好,不知道为什么视频中输出结果为5,我的结果一直为3,不过不影响使用
        N=length(x)
        
        for i=1:N
        fprintf(fid,'(%8.4f %8.4f %8.4f) \n',0,0,Uz(i));
        end
        
        fclose(fid)
        
        

        0_1545217781545_7be93b21-67bc-454a-94e0-ebcd256ac948-image.png

        0_1545215405217_03c8ce27-6a6c-4acc-abac-a45bbef4ec72-image.png

        其实第3步完全可以用excel做。。。。。。。

      4. 把得到的vector的值带入到0/U中
        0_1545218022098_fb103f76-1896-4296-a840-d3f675d77abd-image.png

      5. 进入paraview中查看即可

        0_1545218042261_365addff-5093-4e67-9908-c49de0f74690-image.png

      posted in OpenFOAM
      星
      星星星星晴

    Latest posts made by 星星星星晴

    • 为什么打开论坛后会自动下载一个叫composer.tpl的文件?

      HTML文件,内容如下

      <div component="composer" class="composer<!-- IF resizable --> resizable<!-- ENDIF resizable --><!-- IF !isTopicOrMain --> reply<!-- ENDIF !isTopicOrMain -->">
      
      	<div class="composer-container">
      		<nav class="navbar navbar-fixed-top mobile-navbar hidden-md hidden-lg">
      			<div class="btn-group">
      				<button class="btn btn-sm btn-primary composer-discard" data-action="discard" tabindex="-1"><i class="fa fa-times"></i></button>
      				<button class="btn btn-sm btn-primary composer-minimize" data-action="minimize" tabindex="-1"><i class="fa fa-minus"></i></button>
      			</div>
      			<!-- IF isTopic -->
      			<div class="category-name-container">
      				<span class="category-name"></span> <i class="fa fa-sort"></i>
      			</div>
      			<!-- ENDIF isTopic -->
      			<!-- IF !isTopicOrMain -->
      			<h4 class="title">[[topic:composer.replying_to, "{title}"]]</h4>
      			<!-- ENDIF !isTopicOrMain -->
      			<div class="btn-group">
      				<button class="btn btn-sm btn-primary composer-submit" data-action="post" tabindex="-1"><i class="fa fa-chevron-right"></i></button>
      			</div>
      		</nav>
      		<div class="row title-container">
      			<!-- IF showHandleInput -->
      			<div data-component="composer/handle">
      				<input class="handle form-control" type="text" tabindex="1" placeholder="[[topic:composer.handle_placeholder]]" value="{handle}" />
      			</div>
      			<!-- ENDIF showHandleInput -->
      			<div data-component="composer/title">
      				<!-- IF isTopicOrMain -->
      				<input class="title form-control" type="text" tabindex="1" placeholder="[[topic:composer.title_placeholder]]" value="{title}"/>
      				<!-- ELSE -->
      				<span class="title form-control">[[topic:composer.replying_to, "{title}"]]</span>
      				<!-- ENDIF isTopicOrMain -->
      				<ul class="dropdown-menu quick-search-results hidden">
      					{{{each posts}}}
      <li>
      	<a href="{config.relative_path}/post/{posts.pid}">
      		{buildAvatar(posts.user, "sm", true)}
      		<span class="quick-search-title">{posts.topic.title}</span>
      		<br/>
      		<p class="snippet">
      		{posts.snippet}
      		</p>
      		<small class="post-info pull-right">
      			<span class="fa-stack" style="{function.generateCategoryBackground, posts.category}"><i style="color:{posts.category.color};" class="fa {posts.category.icon} fa-stack-1x"></i></span> {posts.category.name} &bull;
      			<span class="timeago" title="{posts.timestampISO}"></span>
      		</small>
      	 </a>
      </li>
      <!-- IF !@last -->
      <li role="separator" class="divider"></li>
      <!-- ENDIF -->
      {{{end}}}
      <!-- IF multiplePages -->
      <li class="text-center">
      	<a href="{url}">
      		[[search:see-more-results, {matchCount}]]
      	</a>
      </li>
      <!-- ENDIF multiplePages -->
      				</ul>
      			</div>
      
      			<!-- IF isTopic -->
      			<div class="category-list-container hidden-sm hidden-xs"></div>
      			<!-- ENDIF isTopic -->
      
      			<div class="pull-right draft-icon hidden-xs hidden-sm"></div>
      
      			<div class="btn-group pull-right action-bar hidden-sm hidden-xs">
      				<button class="btn btn-default composer-discard" data-action="discard" tabindex="-1"><i class="fa fa-times"></i> [[topic:composer.discard]]</button>
      
      				<button class="btn btn-primary composer-submit" data-action="post" tabindex="6"><i class="fa fa-check"></i> [[topic:composer.submit]]</button>
      			</div>
      		</div>
      
      		<div class="category-tag-row">
      			<div class="btn-toolbar formatting-bar">
      				<ul class="formatting-group">
      					<!-- BEGIN formatting -->
      						<!-- IF formatting.spacer -->
      						<li class="spacer"></li>
      						<!-- ELSE -->
      						<!-- IF !formatting.mobile -->
      						<li tabindex="-1" data-format="{formatting.name}" title="{formatting.title}"><i class="{formatting.className}"></i></li>
      						<!-- ENDIF !formatting.mobile -->
      						<!-- ENDIF formatting.spacer -->
      					<!-- END formatting -->
      
      					<!--[if gte IE 9]><!-->
      						<!-- IF privileges.upload:post:image -->
      						<li class="img-upload-btn hide" data-format="picture" tabindex="-1" title="[[modules:composer.upload-picture]]">
      							<i class="fa fa-file-image-o"></i>
      						</li>
      						<!-- ENDIF privileges.upload:post:image -->
      						<!-- IF privileges.upload:post:file -->
      						<li class="file-upload-btn hide" data-format="upload" tabindex="-1" title="[[modules:composer.upload-file]]">
      							<span class="fa-stack">
      								<i class="fa fa-file-o fa-stack-1x"></i>
      								<i class="fa fa-arrow-up fa-stack-1x"></i>
      							</span>
      						</li>
      						<!-- ENDIF privileges.upload:post:file -->
      					<!--<![endif]-->
      
      					<!-- IF allowTopicsThumbnail -->
      					<li tabindex="-1">
      						<i class="fa fa-th-large topic-thumb-btn topic-thumb-toggle-btn hide" title="[[topic:composer.thumb_title]]"></i>
      					</li>
      					<div class="topic-thumb-container center-block hide">
      						<form id="thumbForm" method="post" class="topic-thumb-form form-inline" enctype="multipart/form-data">
      							<img class="topic-thumb-preview"></img>
      							<div class="form-group">
      								<label for="topic-thumb-url">[[topic:composer.thumb_url_label]]</label>
      								<input type="text" id="topic-thumb-url" class="form-control" placeholder="[[topic:composer.thumb_url_placeholder]]" />
      							</div>
      							<div class="form-group">
      								<label for="topic-thumb-file">[[topic:composer.thumb_file_label]]</label>
      								<input type="file" id="topic-thumb-file" class="form-control" />
      							</div>
      							<div class="form-group topic-thumb-ctrl">
      								<i class="fa fa-spinner fa-spin hide topic-thumb-spinner" title="[[topic:composer.uploading]]"></i>
      								<i class="fa fa-times topic-thumb-btn hide topic-thumb-clear-btn" title="[[topic:composer.thumb_remove]]"></i>
      							</div>
      						</form>
      					</div>
      					<!-- ENDIF allowTopicsThumbnail -->
      
      					<form id="fileForm" method="post" enctype="multipart/form-data">
      						<!--[if gte IE 9]><!-->
      							<input type="file" id="files" name="files[]" multiple class="gte-ie9 hide"/>
      						<!--<![endif]-->
      						<!--[if lt IE 9]>
      							<input type="file" id="files" name="files[]" class="lt-ie9 hide" value="Upload"/>
      						<![endif]-->
      					</form>
      				</ul>
      			</div>
      		</div>
      
      		<div class="row write-preview-container">
      			<div class="write-container">
      				<div class="help-text">
      					<span class="help hidden">[[modules:composer.compose]] <i class="fa fa-question-circle"></i></span>
      					<span class="toggle-preview hide">[[modules:composer.show_preview]]</span>
      				</div>
      				<div class="pull-right draft-icon hidden-md hidden-lg"></div>
      				<textarea class="write" tabindex="4"></textarea>
      			</div>
      			<div class="hidden-sm hidden-xs preview-container">
      				<div class="help-text">
      					<span class="toggle-preview">[[modules:composer.hide_preview]]</span>
      				</div>
      				<div class="preview well"></div>
      			</div>
      		</div>
      
      		<!-- IF isTopicOrMain -->
      		<div class="tag-row">
      			<div class="tags-container">
      				<div class="btn-group dropup <!-- IF !tagWhitelist.length -->hidden<!-- ENDIF !tagWhitelist.length -->" component="composer/tag/dropdown">
      					<button class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">
      						<span class="visible-sm-inline visible-md-inline visible-lg-inline"><i class="fa fa-tags"></i></span>
      						<span class="caret"></span>
      					</button>
      
      					<ul class="dropdown-menu">
      						<!-- BEGIN tagWhitelist -->
      						<li data-tag="@value"><a href="#">@value</a></li>
      						<!-- END tagWhitelist -->
      					</ul>
      				</div>
      				<input class="tags" type="text" class="form-control" placeholder="[[tags:enter_tags_here, {minimumTagLength}, {maximumTagLength}]]" tabindex="5"/>
      			</div>
      		</div>
      		<!-- ENDIF isTopicOrMain -->
      
      		<!-- IF isTopic -->
      		<ul class="category-selector visible-xs visible-sm">
      
      		</ul>
      		<!-- ENDIF isTopic -->
      
      		<div class="imagedrop"><div>[[topic:composer.drag_and_drop_images]]</div></div>
      
      		<div class="resizer"><div class="trigger text-center"><i class="fa"></i></div></div>
      	</div>
      </div>
      
      
      posted in C斯达克
      星
      星星星星晴
    • RE: 提取终端输出的数据

      gnuplot 配合grep

      posted in OpenFOAM
      星
      星星星星晴
    • 编译遇到的问题

      最近在更新单位的code 从of4 到of7,因为同事发现lagrangian 这部分新版本很快。。
      但是遇到了这样的问题,编译也通过了,但是这个提示总有一种不舒服的感觉。。
      请问有什么解决办法么

      Allwmake /home/parallels/OpenFOAM/parallels-7/src/lagrangian
      wmake distributionModels
      wmake intermediate
      wmakeLnIncludeAll: running wmakeLnInclude on dependent libraries:
          wmakeLnInclude error: base directory /lagrangian/distributionModels/ does not exist
      wmake turbulence
      wmakeLnIncludeAll: running wmakeLnInclude on dependent libraries:
          wmakeLnInclude error: base directory /lagrangian/intermediate/ does not exist
          wmakeLnInclude error: base directory /lagrangian/distributionModels/ does not exist
      wmake spray
      wmakeLnIncludeAll: running wmakeLnInclude on dependent libraries:
          wmakeLnInclude error: base directory /lagrangian/intermediate/ does not exist
          wmakeLnInclude error: base directory /lagrangian/distributionModels/ does not exist
          wmakeLnInclude error: base directory /lagrangian/turbulence/ does not exist
      Making dependency list for source file makeBasicSprayParcelSubmodels.C
      
      
      posted in OpenFOAM
      星
      星星星星晴
    • RE: 关于网格内particle的平均速度求解

      @zhe 因为最后一步你重新给p.U()速度了啊。。

      posted in OpenFOAM
      星
      星星星星晴
    • RE: 关于网格内particle的平均速度求解

      这个可以写的地方有很多,比如cloudfunction,或者cloud中,在solver中也能求。
      也不知道你这个写在哪了。。
      我是在particlecollector这个cloudfunction基础上写的 直接输出file 比较好后处理,

      你如果想再paraview 中直接看的话,我们同事是在cloud中写这个field,然后在solver中对其进行平均,比如每100 iteration 平均一次。。

      posted in OpenFOAM
      星
      星星星星晴
    • RE: 有人会画三维柱状图么?

      @李东岳 anaconda 下这个软件 然后什么包都不用装了 anaconda里面的spyder的ide用起来很简单,但是不能旋转图了,还是terminal出来的图的那个还可以旋转~
      大佬不用python么?

      posted in C斯达克
      星
      星星星星晴
    • RE: SprayFoam的颗粒可以作为多组分的吗?

      可以多组分的,你得在thermo那边设置 mixture properties,然后在sprayclouldproperties中设置parcel的mixture的其他东西。
      建议研究一下tut的reactingparcel,sprayparcel就是在reactingparcel的基础上增加了一些其他模型,也不明白为什么of将sprayparcel单独拿出来,不是放到reactingparcel哪个文件夹中。。

      posted in OpenFOAM
      星
      星星星星晴
    • RE: 在lagrangian库里面添加新模型时出现的问题

      你用的是哪个版本
      有的时候需要添加这么几句话在intermediate的options 中
      7455103e-73f7-43cb-bc90-961f71ed7ed4-image.png
      89443054-a799-4a77-919f-9a3c7330da27-image.png

      在files中要对你自己intermediate的lib重新命名
      60157a5d-3a18-43f4-b859-5cd0049f3eec-image.png

      posted in OpenFOAM
      星
      星星星星晴
    • RE: 有人会画三维柱状图么?

      @李东岳

      https://pythonpedia.com/en/knowledge-base/38698277/plot-normal-distribution-in-3d

      posted in C斯达克
      星
      星星星星晴
    • RE: 有人会画三维柱状图么?

      https://wizardforcel.gitbooks.io/matplotlib-intro-tut/content/matplotlib/31.html
      把x3y3dz改为你的数据就行,剩下的就是设置图的其他东西了
      为啥恢复间隔300s。。。

      posted in C斯达克
      星
      星星星星晴