|
[Sponsors] |
flowfield dependent momentum source in simpleFOAM |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 7, 2019, 18:54 |
flowfield dependent momentum source in simpleFOAM
|
#1 |
New Member
Daniel Sampaio
Join Date: Apr 2012
Posts: 1
Rep Power: 0 |
Hi guys, first time I submit a thread to the forum. Although I've used many tips provided here.
I've been trying for a while now to impose a velocity-field-dependent momentum source in a simpleFOAM simulation by configuring fvOptions. I searched many times for similar questions in the forum. Although some have helped me to configure a basic fvOptions file, for uniform, constant source, for example, none lead me to the final task. configuring my source field through something like const vector fonte (fonteX,fonteY,fonteZ); uSource[i] -= fonte; where fonteX, fonteY and fonteZ are scalar functions of the velocity components. The computation carry on if I set these scalars are set as constants or even as function of the cell volume accessed through const scalarField& Vol = mesh().V(); If I set fonteX, fonteY and fonteZ as functions of the velocity components, the simulation is stopped before the first iteration. I'm trying to access the velocity field through the following lines: const vectorField& Vel = eqn.psi(); const direction Xcmpt = 0; const direction Ycmpt = 1; const direction Zcmpt = 2; const scalarField& U = Vel.component(Xcmpt); const scalarField& V = Vel.component(Ycmpt); const scalarField& W = Vel.component(Zcmpt); and the message I get is #0 Foam::error:rintStack(Foam::Ostream&) at ??:? #1 Foam::sigSegv::sigHandler(int) at ??:? #2 __kernel_sigreturn #3 Foam::fv::sourceUFvOptionvectorSource::addSup(Foam ::fvMatrix<Foam::Vector<double> >&, int) at system/fvOptions.codedSource:32 #4 ? in ~/OpenFOAM/OpenFOAM-v1806/platforms/linuxGccDPInt32Opt/bin/simpleFoam #5 main in ~/OpenFOAM/OpenFOAM-v1806/platforms/linuxGccDPInt32Opt/bin/simpleFoam #6 __libc_start_main in /lib/i386-linux-gnu/libc.so.6 #7 ? in ~/OpenFOAM/OpenFOAM-v1806/platforms/linuxGccDPInt32Opt/bin/simpleFoam [1]+ Segmentation fault simpleFoam >> run.log I'm not experienced in C++ programming, but even contributions that demand knowledge about C++ would be very appreciated. Best regards, Daniel |
|
Tags |
fvoptions momentum source |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] Patches to compile OpenFOAM 2.2 on Mac OS X | gschaider | OpenFOAM Installation | 136 | October 10, 2017 18:25 |
Trouble compiling utilities using source-built OpenFOAM | Artur | OpenFOAM Programming & Development | 14 | October 29, 2013 11:59 |
[swak4Foam] swak4Foam-groovyBC build problem | zxj160 | OpenFOAM Community Contributions | 18 | July 30, 2013 14:14 |
"parabolicVelocity" in OpenFoam 2.1.0 ? | sawyer86 | OpenFOAM Running, Solving & CFD | 21 | February 7, 2012 12:44 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |