1 流形和张量场(3)- 度规张量场

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了1 流形和张量场(3)- 度规张量场相关的知识,希望对你有一定的参考价值。

参考技术A 1、度规张量场定义

2、矢量空间定义“距离”

✨为什么要定义距离?因为在一般的空间不像欧氏空间拥有“自然”的距离,我们需要建立一个标准来衡量矢量空间中元素之间的距离。

✨这里要注意,正交性是在度规以及长度定义之后才出现的概念,在还没有度规或者长度概念时,不能说“取一组正交归一的基底”。



3、带度规的矢量空间,其度规对应的对角矩阵中1、-1个数和正交基底无关。

4、正交归一基底对应的对角矩阵分类:正定的(黎曼的)、负定的、不定的(含洛伦兹的)。

5、根据度规大小进行矢量分类

6、 型张量(度规)对对偶重新解读

7、度规张量场

8、度规场的意义——定义曲线长度

9、流形上曲线长度定义

10、类空曲线定义

11、曲线长度与其参数无关,若曲线位于坐标系 的坐标域内,线长可借助于坐标系计算

12、线长参数

✨为什么说 的切 的长度 是 的函数?

每一点的切矢跟点的位置有关。

13、广义黎曼空间、伪黎曼空间

14、n维欧氏空间、欧式度规模

✨欧氏空间自然坐标基底在欧式度规模下是正交规一的

15、笛卡尔坐标系/ 直角坐标系

✨最后一句小心!

16、n维闵氏空间、闵氏度规

17、洛伦兹坐标系、伪笛卡尔坐标系

openFoam:报告湍流场的问题

【中文标题】openFoam:报告湍流场的问题【英文标题】:openFoam: Trouble reporting turbulence fields 【发布时间】:2017-05-22 05:04:13 【问题描述】:

我运行 openFoam 4.1,在我的 k-eps 模拟中提取湍流应力张量 R 时遇到问题。我 4 天前在 cfd-online.com 上问过同样的问题,但没有收到回复,所以我现在希望也许有人可以在这里帮助我。

为了提取R,我只修改了controlDict,如下所示:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.0                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile

    version     2.0;
    format      ascii;
    class       dictionary;
    object      controlDict;

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     simpleFoam;

startTime       0;

stopAt          endTime;

endTime         5000;

deltaT          1;

writeControl    timeStep;

writeInterval   100;

purgeWrite      2;

writeFormat     ascii;

writePrecision  8;

writeCompression uncompressed;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

functions

#includeFunc    residuals

    turbulenceFields1
    
        type            turbulenceFields;
        libs            ("libfieldFunctionObjects.so");
        field           R;
    


// ************************************************************************* //

当我尝试使用上述 controlDict 解决时,我得到以下信息:

/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.1                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 4.1
Exec   : simpleFoam
Date   : May 18 2017
Time   : 07:08:01
Host   : "..."
PID    : 11073
Case   : /home...
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


SIMPLE: convergence criteria
    field p     tolerance 0.001
    field U     tolerance 0.001
    field "(k|epsilon|omega|f|v2)"     tolerance 0.001

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RAS
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs

    Cmu             0.09;
    C1              1.44;
    C2              1.92;
    C3              -0.33;
    sigmak          1;
    sigmaEps        1.3;


No MRF models present

No finite volume options present


Starting time loop

turbulenceFields turbulenceFields1: storing fields:
    turbulenceProperties:R

Time = 1

smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = 0.068919891, No Iterations 6
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 0.094423261, No Iterations 4
smoothSolver:  Solving for Uz, Initial residual = 1, Final residual = 0.065365879, No Iterations 6
GAMG:  Solving for p, Initial residual = 1, Final residual = 0.0086113464, No Iterations 26
time step continuity errors : sum local = 0.51812432, global = -0.07783965, cumulative = -0.07783965
smoothSolver:  Solving for epsilon, Initial residual = 0.59675441, Final residual = 0.051409907, No Iterations 3
smoothSolver:  Solving for k, Initial residual = 1, Final residual = 0.092548244, No Iterations 2
ExecutionTime = 0.81 s  ClockTime = 1 s



--> FOAM FATAL ERROR: 
object of type N4Foam9Function1INS_10SymmTensorIdEEEE is not allocated

    From function T* Foam::autoPtr<T>::operator->() [with T = Foam::Function1<Foam::SymmTensor<double> >]
    in file /home/ubuntu/OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/autoPtrI.H at line 176.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::timeVaryingMappedFixedValueFvPatchField<Foam::SymmTensor<double> >::write(Foam::Ostream&) const at ??:?
#3  Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>::Boundary::writeEntry(Foam::word const&, Foam::Ostream&) const at ??:?
#4  Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>::writeData(Foam::Ostream&) const at ??:?
#5  Foam::regIOobject::writeObject(Foam::IOstream::streamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const at ??:?
#6  Foam::functionObjects::regionFunctionObject::writeObject(Foam::word const&) at ??:?
#7  Foam::functionObjects::turbulenceFields::write() at ??:?
#8  Foam::functionObjectList::execute() at ??:?
#9  Foam::Time::loop() at ??:?
#10  Foam::simpleControl::loop() at ??:?
#11  ? at ??:?
#12  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#13  ? at ??:?
Aborted (core dumped)

从上面看来,openFoam 解决了第一个时间步,然后出现了问题。在目录“1”中,现在只有一个文件“turbulenceProperties:R”,其中包含每个点的应力张量的 6 个元素。

有人知道如何解决这个问题吗?

【问题讨论】:

【参考方案1】:

我想我在 cfd-online 论坛的 this 链接中找到了答案。

【讨论】:

以上是关于1 流形和张量场(3)- 度规张量场的主要内容,如果未能解决你的问题,请参考以下文章

TensorFlow张量Tensor

使用 pyTorch 张量沿一个特定维度和 3 维张量进行索引

pytorch学习系列文章第二篇——张量

如何将张量流张量切成多个

如何在4d张量中为k个最大元素创建单热张量?

tensorflow2.0张量的结构操作