# How to extract gauss coordinates in AceGen/ AceFEM?

I am trying to implement a 2D turbulence problem with the model of Spalart-Allmaras. Therefore, I need to extract the global gauss coordinates to define parameter 'd' which stands for the distance to the nearest wall. Does someone know how to extract the global gauss coordinates of the whole computational domain (not for just one element) before performing the simulation?

Thanks and best regards

• We can't implement SA model in general case. There are hundreds implementations for turbulent flow simulation in special cases. What do you try to solve? Mar 21, 2023 at 12:17
• I am trying to solve the turbulent channel benchmark in 2D. Mar 21, 2023 at 13:25
• Here's a link to the benchmark: featool.com/doc/Fluid_Dynamics_09a_turbulent_channel_flow1 Mar 21, 2023 at 13:46
• See my post on mathematica.stackexchange.com/questions/217201/… . We can use eps = 10^-6; d = Sqrt[y^2 + eps^2] in the boundary layer. Mar 21, 2023 at 15:19
• @AlexTrounev: I think this is a directly AceGen/AceFEM related question. This cannot really be related to the Mathematica FEM implementation way.
– Max
Mar 22, 2023 at 8:46

I did this for 3D linear hexahedral element using shape functions and local integration point coordinates:

IPcoor = Table[Table[
Sum[
ShaFun[[inp, isf]]*
SMTNodeData[SMTElementData[elnum, "Nodes"], "X"][[isf]]
, {isf, 1, 8}]
, {inp, 1, 8}],{elnum, 1, NumEl}];


The shape functions were calculated as follows:

{\[Xi]ih, \[Eta]ih, \[Zeta]ih} = {{-1, 1, 1, -1, -1, 1,
1, -1}, {-1, -1, 1, 1, -1, -1, 1, 1}, {-1, -1, -1, -1, 1, 1, 1,
1}};

Nih[xxx_, yyy_, zzz_] := MapThread[1/8 (1 + xxx #1) (1 + yyy #2) (1 +
zzz #3) &, {\[Xi]ih, \[Eta]ih, \[Zeta]ih}]

ShaFun = Table[Nih[IPCS1[[i, 1]], IPCS1[[i, 2]], IPCS1[[i, 3]]], {i, 1, 8}]


And the coordinates of the integration points in the coordinate system of an element are the following.

IPCS1 = {
{-0.5773502691896257,0.5773502691896257,-0.5773502691896257}, {0.5773502691896257, -0.5773502691896257, -0.5773502691896257}, {-0.5773502691896257,0.5773502691896257,-0.5773502691896257}, {0.5773502691896257,0.5773502691896257,-0.5773502691896257},
{-0.5773502691896257,-0.5773502691896257,0.5773502691896257},{0.5773502691896257,-0.5773502691896257,0.5773502691896257}, {-0.5773502691896257,0.5773502691896257,0.5773502691896257}, {0.5773502691896257,0.5773502691896257,0.5773502691896257}
};


You can check the coordinates of integration points of your element e. g. in Appendix C of the book "Automation of finite element methods" by Korelc and Wriggers, Springer, 2016.