|
|
The macros listed in Table 3.2.20- 3.2.23 can be used to return real face variables in SI units. They are identified by the F_ prefix. Note that these variables are available only in the pressure-based solver. In addition, quantities that are returned are available only if the corresponding physical model is active. For example, species mass fraction is available only if species transport has been enabled in the Species Model dialog box in ANSYS FLUENT. Definitions for these macros can be found in the referenced header files (e.g., mem.h).
Face Centroid (
F_CENTROID)
The macro listed in Table 3.2.20 can be used to obtain the real centroid of a face. F_CENTROID finds the coordinate position of the centroid of the face f and stores the coordinates in the x array. Note that the x array is always one-dimensional, but it can be x[2] or x[3] depending on whether you are using the 2D or 3D solver.
The ND_ND macro returns 2 or 3 in 2D and 3D cases, respectively, as defined in Section 3.4.2. Section 2.3.15 contains an example of F_CENTROID usage.
Face Area Vector (
F_AREA)
F_AREA can be used to return the real face area vector (or `face area normal') of a given face f in a face thread t. See Section 2.7.3 for an example UDF that utilizes F_AREA.
By convention in ANSYS FLUENT, boundary face area normals always point out of the domain. ANSYS FLUENT determines the direction of the face area normals for interior faces by applying the right hand rule to the nodes on a face, in order of increasing node number. This is shown in Figure 3.2.1.
ANSYS FLUENT assigns adjacent cells to an interior face ( c0 and c1) according to the following convention: the cell out of which a face area normal is pointing is designated as cell C0, while the cell in to which a face area normal is pointing is cell c1 (Figure 3.2.1). In other words, face area normals always point from cell c0 to cell c1.
Flow Variable Macros for Boundary Faces
The macros listed in Table 3.2.22 access flow variables at a boundary face.
# Usar una imagen base de Windows Server Core con soporte para contenedores FROM mcr.microsoft.com/windows/servercore:ltsc2022 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] Crear directorio de trabajo WORKDIR C:\tools\bwfmetaedit Copiar el bwfmetaedit.exe descargado localmente COPY bwfmetaedit.exe . Copiar script de entrada (opcional) COPY process-audio.ps1 . Establecer el punto de entrada ENTRYPOINT ["C:\tools\bwfmetaedit\bwfmetaedit.exe"] Paso 2: Construir y subir la imagen # Construir (desde la carpeta donde está el Dockerfile y el exe) docker build -t miregistro/bwfmetaedit:1.0 . Subir a un registry accesible por Kubernetes (ACR, ECR, Docker Hub) docker push miregistro/bwfmetaedit:1.0 Sección 5: Desplegar en Kubernetes (Modo Job y CronJob) No desplegará un Pod corriendo 24/7, sino un Job que ejecute el proceso y termine. Ejemplo 1: Job básico para editar metadatos de un archivo apiVersion: batch/v1 kind: Job metadata: name: bwf-metaedit-job spec: template: metadata: name: bwf-metaedit-pod spec: # Node selector para forzar nodos Windows nodeSelector: kubernetes.io/os: windows containers: - name: bwf-editor image: miregistro/bwfmetaedit:1.0 args: - "--in-place" - "--Description=Grabación Kubernetica" - "C:\\data\\audio\\entrada.wav" volumeMounts: - name: audio-storage mountPath: C:\data restartPolicy: Never volumes: - name: audio-storage persistentVolumeClaim: claimName: audio-pvc Ejemplo 2: CronJob para procesado periódico Ideal para revisar archivos entrantes cada hora:
# Desde PowerShell en Windows Invoke-WebRequest -Uri "https://mediaarea.net/download/binary/bwfmetaedit/23.10/BWFMetaEdit_CLI_23.10_Windows_x86_64.zip" -OutFile "bwfmetaedit.zip" Expand-Archive -Path bwfmetaedit.zip -DestinationPath C:\tools\bwfmetaedit No descargue EXEs de sitios de terceros. Solo de mediaarea.net . Sección 4: Construcción de la Imagen Docker para Kubernetes Para que Kubernetes ejecute bwfmetaedit.exe , debe empaquetarlo en un contenedor. Paso 1: Crear el Dockerfile Cree un archivo Dockerfile (para Windows Containers): descargar bwf metaedit exe kubernetes
Introducción En el mundo de la radiodifusión, el postproducción de audio y la preservación de archivos, el formato BWF (Broadcast Wave Format) es el estándar de oro. Herramientas como BWF MetaEdit —desarrollada por la Biblioteca del Congreso de los Estados Unidos— son esenciales para incrustar, editar y validar metadatos críticos (como el bext chunk, el UMID o el lobo de tiempo). # Usar una imagen base de Windows Server
initContainers: - name: download-bwf image: curlimages/curl:latest command: ['sh', '-c', 'curl -L https://mediaarea.net/download/binary/bwfmetaedit/23.10/bwfmetaedit.exe -o /tools/bwfmetaedit.exe'] volumeMounts: - name: tool-bin mountPath: /tools Aunque existe la posibilidad de ejecutar bwfmetaedit.exe sobre Linux mediante Wine dentro de un contenedor, es frágil y lento. Prefiera siempre el binario nativo para Linux (si su flujo lo permite). 3. Patrón Sidecar para procesamiento de streaming Si tiene un pod que recibe archivos de audio continuamente, puede usar un sidecar con bwfmetaedit.exe escuchando en un volumen compartido. Subir a un registry accesible por Kubernetes (ACR,
apiVersion: batch/v1 kind: CronJob metadata: name: bwf-metaedit-cron spec: schedule: "0 * * * *" # Cada hora jobTemplate: spec: template: spec: nodeSelector: kubernetes.io/os: windows containers: - name: metaedit-task image: miregistro/bwfmetaedit:1.0 args: - "--Report" - "C:\\data\\reportes\\output.xml" - "C:\\data\\entrantes\\*.wav" volumeMounts: - name: shared-storage mountPath: C:\data restartPolicy: OnFailure volumes: - name: shared-storage nfs: # o PVC, o Azure File, etc. server: nfs-server.default.svc.cluster.local. path: /shared_audio 1. Uso de InitContainers para descargar el EXE dinámicamente En lugar de empaquetar el EXE en la imagen, puede descargarlo en un emptyDir compartido usando un initContainer :
See Section 2.7.3 for an example UDF that utilizes some of these macros.
Flow Variable Macros at Interior and Boundary Faces
The macros listed in Table 3.2.23 access flow variables at interior faces and boundary faces.
| Macro | Argument Types | Returns |
| F_P(f,t) | face_t f, Thread *t, | pressure |
| F_FLUX(f,t) | face_t f, Thread *t | mass flow rate through a face |
F_FLUX can be used to return the real scalar mass flow rate through a given face f in a face thread t. The sign of F_FLUX that is computed by the ANSYS FLUENT solver is positive if the flow direction is the same as the face area normal direction (as determined by F_AREA - see Section 3.2.4), and is negative if the flow direction and the face area normal directions are opposite. In other words, the flux is positive if the flow is out of the domain, and is negative if the flow is in to the domain.
Note that the sign of the flux that is computed by the solver is opposite to that which is reported in the ANSYS FLUENT GUI (e.g., the Flux Reports dialog box).