|
[Sponsors] |
April 24, 2019, 19:56 |
magneticFoam problem
|
#1 |
New Member
Luis Lencina
Join Date: May 2010
Posts: 12
Rep Power: 16 |
Hi everyone,
I am trying to solve a magnetic problem with openfoam 1812, I download a case file that i found in the forum, and i found some problems with the code and the input. I attach both. The problem that i cannot solve is that the facezones generated by toposet program use the global index of the mesh. When i try to set the surfacescalarfield murf usign the operator[] it only contains the internal surfacemesh, so it try to write outside the vector lenght. i add this lines to createFields.H Info<<"mesh "<<mesh.faces().size()<<endl; Info<<"murf "<<murf.size()<<endl; and the output is mesh 40200 murf 19800 so the program crash when it try to set a face beyond 19800. #0 Foam::error:rintStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in /lib64/libc.so.6 #3 Foam:ICPreconditioner::calcReciprocalD(Foam::Fie ld<double>&, Foam::lduMatrix const&) at ??:? #4 Foam:ICPreconditioner:ICPreconditioner(Foam::l duMatrix::solver const&, Foam::dictionary const&) at ??:? #5 Foam::lduMatrix:reconditioner::addsymMatrixConst ructorToTable<Foam:ICPreconditioner>::New(Foam:: lduMatrix::solver const&, Foam::dictionary const&) at ??:? #6 Foam::lduMatrix:reconditioner::New(Foam::lduMatr ix::solver const&, Foam::dictionary const&) at ??:? #7 Foam::PCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:? #8 Foam::fvMatrix<double>::solveSegregated(Foam::dict ionary const&) at ??:? #9 Foam::fvMatrix<double>::solveSegregatedOrCoupled(F oam::dictionary const&) at ??:? #10 Foam::fvMesh::solve(Foam::fvMatrix<double>&, Foam::dictionary const&) const at ??:? #11 ? at ??:? #12 __libc_start_main in /lib64/libc.so.6 #13 ? at ??:? Floating point exception (core dumped) Can anyone help me? thanks |
|
April 28, 2019, 09:00 |
|
#2 |
New Member
Luis Lencina
Join Date: May 2010
Posts: 12
Rep Power: 16 |
Well, now I understand the problem, the first nodes are always the internal faces, then there are the boundary faces. I don't know how to set the boundary nodes, but i change this and it works
forAll(magnets, i) { label magnetZonei = mesh.faceZones().findZoneID(magnets[i].name()); if (magnetZonei == -1) { FatalIOErrorInFunction(transportProperties) << "Cannot find faceZone for magnet " << magnets[i].name() << exit(FatalIOError); } const labelList& faces = mesh.faceZones()[magnetZonei]; const scalar muri = magnets[i].mur(); const scalar Mri = magnets[i].Mr().value(); const vector& orientationi = magnets[i].orientation(); const surfaceVectorField& Sf = mesh.Sf(); forAll(faces, i) { label facei = faces[i]; if(facei < murf.size()){ murf[facei] = muri; Mrf[facei] = Mri*(orientationi & Sf[facei]); } } } |
|
Tags |
magneticfoam, surfacescalarfields |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
Gambit - meshing over airfoil wrapping (?) problem | JFDC | FLUENT | 1 | July 11, 2011 06:59 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |
Is this problem well posed? | Thomas P. Abraham | Main CFD Forum | 5 | September 8, 1999 15:52 |