CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM

flowfield dependent momentum source in simpleFOAM

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   September 7, 2019, 18:54
Question flowfield dependent momentum source in simpleFOAM
New Member
Daniel Sampaio
Join Date: Apr 2012
Posts: 1
Rep Power: 0
daniel_BA is on a distinguished road
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/
#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_BA is offline   Reply With Quote


fvoptions momentum source

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[] 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

All times are GMT -4. The time now is 12:13.