tecplot 在使用dynamic text 时 &(solutiontime)如何保留有效数字?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tecplot 在使用dynamic text 时 &(solutiontime)如何保留有效数字?相关的知识,希望对你有一定的参考价值。

参考技术A To display the message "Maximum contour value is: xxxxxx" where xxxxxx only has two digits to the right of the decimal place. You would use:

"Maximum contour value is: &(MAXC%.2f)"

If |MAXC| currently has a value of 356.84206 then the dialog would show:

"Maximum contour value is: 356.84"

所以这样引用 &(SOLUTIONTIME%.2f)即可,与C语言格式化字符串类似。本回答被提问者采纳

MATLAB读取TECPLOT笛卡尔网格三维流场数据

tecplot按照网格点逐点输出数据到文件,一个点的坐标及其相关数据写成一行,更具数据文件头可以知道,一行含七个数据,分别是x,y,z,u,v,w,rho。

1、matlab读取tecplot文件,将数据存贮到三维数组中,并保存变量到mat文件以供调用

% read data from tecplot file 
% save the data as the three dimension arrays
function [x,y,z,u,v,w,rho]=tecplot2mat(filename,num_head)
%% tecplot data file read
fid = fopen(strcat(filename,‘.dat‘));
data = textscan(fid,‘%f %f %f %f %f %f %f‘,‘headerlines‘,num_head);
data = cell2mat(data);
fclose(fid);

%% reshape data
% get discrete points
xi = sort(unique(data(:,1)));
yi = sort(unique(data(:,2)));
zi = sort(unique(data(:,3)));

% number of the discrete points
num_x = length(xi);
num_y = length(yi);
num_z = length(zi);

% initialize the three demonsions array
x = zeros(num_x,num_y,num_z);
y = zeros(num_x,num_y,num_z);
z = zeros(num_x,num_y,num_z);
u = zeros(num_x,num_y,num_z);
v = zeros(num_x,num_y,num_z);
w = zeros(num_x,num_y,num_z);
rho = zeros(num_x,num_y,num_z);

% assignment the array according to the data
for n = 1:size(data,1)
%     % if we don‘t know the relationship between the number and the index,we
%     % must find the index according to the number
%     index_x = find(data(n,1) == xi);
%     index_y = find(data(n,2) == yi);
%     index_z = find(data(n,3) == zi);
    % if we know the relationship between the number and the index, we can
    % directly access the index
    index_x = data(n,1) + 1;
    index_y = data(n,2) + 1;
    index_z = data(n,3) + 1;
    % access the data
    x(index_x,index_y,index_z) = data(n,1);
    y(index_x,index_y,index_z) = data(n,2);
    z(index_x,index_y,index_z) = data(n,3);
    u(index_x,index_y,index_z) = data(n,4);
    v(index_x,index_y,index_z) = data(n,5);
    w(index_x,index_y,index_z) = data(n,6);
    rho(index_x,index_y,index_z) = data(n,7);
end

fprintf(‘reshape the data\n‘);

%% data save to mat
eval([‘save ‘,filename,‘ x y z u v w rho;‘]);

fprintf(‘save the data\n‘);
end

2、测试函数

clc;clear;
close all;

file_info = dir(‘*.dat‘);
file_num = length(file_info);
num_head = 3;
for i = 1:file_num
    [~,~,~,~,~,~,~]=tecplot2mat(file_info(i).name,num_head);
end

 

以上是关于tecplot 在使用dynamic text 时 &(solutiontime)如何保留有效数字?的主要内容,如果未能解决你的问题,请参考以下文章

[求助]tecplot二维图中的坐标问题

怎么用tecplot 读取流场马赫数

如何在tecplot中获取曲线上某一点的数值

tecplot打开.gz文件

tecplot如何根据公式画云图

用tecplot打开fluent的dat文件出现了问题