帮助该程序的语言? [英] Help with the language of this program??

查看:100
本文介绍了帮助该程序的语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用哪种编程语言或平台编写了以下代码,并且从以下代码到C#或FORTRAN的转换器是否存在?

With what programming language or platform the following code has been written and is there any convertor from the following code to C# or FORTRAN?

#include "udf.h" /* must be at the beginning of every UDF */
#include "sg.h" /* must be at the beginning of this UDF */
#include "math.h" /* must be at the beginning of this UDF */
/*Set preprocessor directives here in order to change
behaviour of the routine:*/
#define not SCHEMEMFP /* shall MeanFreePath be scheme var.? */
#define SCHEMETMAC /* shall TMAC ... */
#define SCHEMEUDRLXCOEFF /* shall the under-relaxation
coefficient... */
#define not SCHEMEThAC /* shall ThAC ... */
#define not SCHEMESpHR /* shall SpHR ... */
#define SCHEMESIGMASQUARE /* shall sigma-square value... */
#define SCHEMEAMBPRESS /* shall ambient pressure value... */
34 A. Computational Routine
#define UNDERRLX /* shall slip veloc be under-relaxated in
severe cases? */
#define WALLMOTION /* shall wall-motion be regarded? */
/*
If the scheme variables are not used fall back to some default
values as below, also some constants are defined
*/
#ifndef SCHEMESIGMASQUARE
#define sigma_square 1.35305239e-19 /* squared value of
sigma(molecule diameter) */
#endif
#ifndef SCHEMEAMBPRESS
#define ambpress 101325 /* ambient pressure */
#endif
#ifndef SCHEMETMAC
#define TMAC 1.0 /* tangential momentum accomodation
coefficient */
#endif
#ifndef SCHEMEThAC
#define ThAC 1.0 /* thermal accomodation coefficient */
#endif
#ifndef SCHEMESpHR
#define SpHR 1.4 /* specific heat ratio; Air, Oxygen,
Nitrogen */
#endif
#ifndef SCHEMEUDRLXCOEFF
#define UDRLXCOEFF 0.02 /* under-relaxation coefficient */
#endif
#define Boltzmann 1.3806505e-23 /* Boltzmann constant */
#define PI 3.14159265358979323846 /* number pi */
#define SQRT_2 1.41421356237309504880 /* sqrt(2) */
A.1. Slip Velocity Routine 35


DEFINE_PROFILE(maxwell_slip_velocity_x_full,f_thread,index)
{
#ifdef SCHEMETMAC
real TMAC=1;
TMAC=RP_Get_Real("tmac");
#endif
real MeanFreePath=6.8e-8;
#ifdef SCHEMEMFP
MeanFreePath=RP_Get_Real("meanfreepath");
#endif
#ifdef SCHEMEUDRLXCOEFF
real UDRLXCOEFF=0.2;
UDRLXCOEFF=RP_Get_Real("udrlxcoeff");
#endif
#ifdef SCHEMESIGMASQUARE
real sigma_square=1.0e-19;
sigma_square=RP_Get_Real("sigmasquare");
#endif
#ifdef SCHEMEAMBPRESS
real ambpress;
ambpress=RP_Get_Real("ambpress");
#endif
face_t face;
cell_t cell;
36 A. Computational Routine
Thread *c_thread;
real slip, thcreep, dveloc;
real normal_slip, tangential_slip, tangential_thcreep;
real Coeff1[ND_ND], Coeff2[ND_ND];
real u[ND_ND];
/* call the routine that computes transformation coefficients,
once per iteration is sufficient
coord_coeff(f_thread) is called only in the velocity
$x$-coordinate routine and activated by the coordeval
scheme variable(integer) */
if (RP_Get_Integer("coordeval")==1) coord_coeff(f_thread)
if ((RP_Get_Integer("tempgradeval")>1)&&(Data_Valid_P()))
{
begin_f_loop(face,f_thread)
{
/* get cell and cell thread pointer */
cell=F_C0(face,f_thread);
c_thread=THREAD_T0(f_thread);
/* compute mean free path at every position */
#ifndef SCHEMEMFP
MeanFreePath = Boltzmann * F_T(face,f_thread) / (
sigma_square * (F_P(face,f_thread)+ambpress)*
PI * SQRT_2 ) ;
#endif
.
.
.
.
.
.
.



谢谢



Thanks

推荐答案

x


-坐标例程并由coordeval激活 方案变量(整数)*/ 如果(RP_Get_Integer("coordeval")== 1)coord_coeff(f_thread) 如果(((RP_Get_Integer("tempgradeval")> 1)&((Data_Valid_P()))) { begin_f_loop(face,f_thread) { /*获取单元格和单元格线程指针*/ cell = F_C0(face,f_thread); c_thread = THREAD_T0(f_thread); /*计算每个位置的平均自由路径*/ #ifndef SCHEMEMFP MeanFreePath = Boltzmann * F_T(face,f_thread)/( sigma_square *(F_P(face,f_thread)+ ambpress)* PI * SQRT_2); #万一 . . . . . .
-coordinate routine and activated by the coordeval scheme variable(integer) */ if (RP_Get_Integer("coordeval")==1) coord_coeff(f_thread) if ((RP_Get_Integer("tempgradeval")>1)&&(Data_Valid_P())) { begin_f_loop(face,f_thread) { /* get cell and cell thread pointer */ cell=F_C0(face,f_thread); c_thread=THREAD_T0(f_thread); /* compute mean free path at every position */ #ifndef SCHEMEMFP MeanFreePath = Boltzmann * F_T(face,f_thread) / ( sigma_square * (F_P(face,f_thread)+ambpress)* PI * SQRT_2 ) ; #endif . . . . . . .



谢谢



Thanks


这看起来确实很像C,但是单单说它是C看起来并不对劲.它确实具有态度".还有一些分散的行看起来更像是来自文档(页脚和节标题),而不是源代码文件.

与我的朋友Google进行了几次协商后,我将其固定下来.

这不是来自源代码文件.其中一些行不是代码.这是从本文档 [该公司 [
This does look very much like C, but it doesn''t look quite right to me to simply say that it is C. It definitely has an "attitude" associated with it. There are also lines scattered in there that look more like they are coming from a document (page footers & section headings) rather than from a source code file.

After a couple consultations with my friend Google, I have pinned it down.

This is not from a source code file. Some of these lines are not code. This is an extract from this document[^]. It is C code written as an add-in for a commercial software package, as you could have told from reading the beginning of the document. This company[^] seems to have bought, or be, the company that produced that software package. Which of their products is the one you are interested in, I''m not going to figure out for you.

Do note that this code is set up so that it can be compiled in different ways for different uses by changing #defines in the source code.

Beside a language change ( for what reason? ), you are evidently not going to be using the software package this was intended to work with. There is more going on here than "just" a conversion. I would say that the only converter that may work is a human who actually understands the situation you are dealing and can fill in what may be a lot of blanks.


这篇关于帮助该程序的语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆