otaolafr
02/12/2024, 7:49 AMESI
{
name inletAMI;
patchInfo
{
type cyclicAMI;
matchTolerance 0.0001;
neighbourPatch outletAMI;
transform translational;
separationVector (0 0 1);
}
constructFrom patches;
patches (inlet);
}
Extend
{
name inletAMI;
dictionary
{
type cyclicGgi;
zone cyclicPatchesZoneInlet;
shadowPatch outletAMI;
bridgeOverlap true;
rotationAngle 0.0;
rotationAxis (0 0 1);
rotationCentre (0 0 0);
separationOffset (0 0 1);
}
constructFrom patches;
patches (inlet);
}
any one that has an idea in this subject? (also If I use bridgeOverlap false, the createPatch will crash)
https://cdn.discordapp.com/attachments/814043123810304041/1206507414095003658/createPatchDictESI?ex=65dc4297&is=65c9cd97&hm=33ad8ff52fb010120dfe79d051c86879ec4b05e7b355b5f9e012337ebc8722a7&
https://cdn.discordapp.com/attachments/814043123810304041/1206507414656909332/createPatchDictExtend?ex=65dc4297&is=65c9cd97&hm=39054ec3710c3c2e05291893a9fefabe79ac8a058b9c900b8701e7edbb2d3fac&_boludo
02/17/2024, 9:43 PM_boludo
02/17/2024, 9:57 PMqr
02/25/2024, 8:33 AMpaketbote
02/25/2024, 10:17 AMqr
02/25/2024, 10:43 AMsigmamale0107
03/11/2024, 7:55 PMsigmamale0107
03/11/2024, 7:55 PMfleurdepassion
03/13/2024, 5:58 AMcpp
forAll(dJ4bydTVol,celli){
if((mag(U[celli] & gradT[celli]) < lim_J4 )) {
dJ4bydTVol[celli] = vector(0.,0.,0.) ;
} else {
dJ4bydTVol[celli] =
1/pow(mag(Foam::mag(U[celli])*Foam::mag(gradT[celli])) + petit,2)*
(
U[celli]*(Foam::mag(U[celli])*Foam::mag(gradT[celli]) + petit)
- gradT[celli]*(U[celli] & gradT[celli])*Foam::mag(U[celli])/Foam::mag(gradT[celli])
);
}
}
fleurdepassion
03/13/2024, 6:04 AMfleurdepassion
03/13/2024, 6:04 AMcpp
label NC = mesh.nCells(); // Number of cells
simpleMatrix<scalar> A(NC); // Coeff.matrix
// Initialization of matrix
for (label i = 0; i < NC; i++) {
A.source()[i] = 0.0;
for (label j = 0; j < NC; j++) {
A[i][j] = 0.0;
}
}
// Source
OFstream matA (string("./mat_A"));
OFstream matb (string("./mat_b"));
OFstream matsol(string("./mat_sol"));
for (label i = 0; i < NC; i++) {
A.source()[i] = paEqn.source()[i];
Info << A.source()[i] << endl;
}
// Assigning diagonal coefficients
for (label i = 0; i < NC; i++) {
A[i][i] = paEqn.diag()[i];
}
// Assigning off-diagonal coefficients
for (label faceI = 0; faceI < paEqn.lduAddr().lowerAddr().size(); faceI++) {
label l = paEqn.lduAddr().lowerAddr()[faceI];
label u = paEqn.lduAddr().upperAddr()[faceI];
A[l][u] = paEqn.upper()[faceI];
A[u][l] = paEqn.upper()[faceI];
}
// Assigning contribution from BC
forAll(pa.boundaryField(), patchI) {
const fvPatch &pp = pa.boundaryField()[patchI].patch();
forAll(pp, faceI) {
label cellI = pp.faceCells()[faceI];
A[cellI][cellI] += paEqn.internalCoeffs()[patchI][faceI];
A.source()[cellI] += paEqn.boundaryCoeffs()[patchI][faceI];
}
}
forAll(pa.boundaryField(), patchI) {
const fvPatch &pp = pa.boundaryField()[patchI].patch();
forAll(pp, faceI) {
label cellI = pp.faceCells()[faceI];
// Info << "boundaryCoeff "<<paEqn.boundaryCoeffs()[patchI]<< endl;
}
}
Info << "\n==Coefficients of Matrix A==" << endl;
for (label i = 0; i < NC; i++) {
for (label j = 0; j < NC; j++) {
// Info << A[i][j] << " ";
matA << A[i][j] << " ";
}
// Info << " " << endl;
matA << " " << endl;
}
Info << "\n==Coefficients of vector b==" << endl;
for (label i = 0; i < NC; i++) {
Info << A.source()[i] << " "<<i<<endl;
matb << A.source()[i] << endl;
}
// Info << "\n==> Solution: " << A.solve() << endl;
matsol << "\n==> Solution: " << paEqn.solve() << endl;
fleurdepassion
03/13/2024, 8:11 AMcpp
// Source
OFstream myFile (string("./mat_A"));
for (label i = 0; i < NC; i++) {
for (label j = 0; j < NC; j++) {
myFile << A[i][j] << " ";
}
}
otaolafr
03/25/2024, 2:16 PMbanana
field
2. get the cloud of my solver appleCloud
3. use the position of the particles in appleCloud
to store what was the value of the banana
field in the cell where each particle of the appleCloud
right now I succesfully read the field, but I can not achieve to read the cloud object.
what I have right now (the commented part is because it makes the compilation of the FO crash):
fieldLagrangeanVol
{
libs (utilityFunctionObjects);
type coded;
name fieldLagrangeanVol;
writeControl timeStep;
writeInterval 10;
// codeInclude
// #{
// #include "basicKinematicCollidingCloud.H"
// #};
codeWrite
#{
const auto& banana = mesh().lookupObject<volScalarField>("banana");
// const auto* objPtr = mesh().findObject<cloud>("appleCloud");
// const auto* objPtr = mesh().findObject<basicKinematicCollidingCloud>("appleCloud");
#};
}
the cloud was declared as:
basicKinematicCollidingCloud appleCloud
(
bubbleCloudName,
rhoInf,
U,
mu,
g
);
pretty sure is quite dumb but havent found anything while looking on cfd online...otaolafr
03/27/2024, 4:19 PMfunctionObject
coded
, so I went to modify the solver itself.
in the solver I achieved to do what I wanted but nevertheless now I want to write the results, of what my lagrangian particles 'see' as field at each time step into a file.
it is 'half' working, it works in serial but in parallel not, I think (not sure) that is writing the information only for the main processor,
word name = "testOfIParcesl" + runTime.timeName() + ".txt";
fileName filename = (name);
OFstream OS(filename);
if (Pstream::master())
{
if(OS.opened())
{
int k = 0;
OS << "n" << tab << "parcel ID" << tab << "(" << "x position " << "y position " << "z position" << ")" << tab
<< "cell ID" << tab << "cell center position" << tab << "I on cell" << endl;
for (basicKinematicCollidingParcel& p : cellCloud)
{
k = k + 1;
OS << k << tab << p.origId() << tab << p.position() << tab
<< p.cell() << tab << mesh.C()[p.cell()] << tab << I[p.cell()] << endl;
}
}
}
qr
03/27/2024, 11:28 PMqr
03/27/2024, 11:30 PMqr
03/27/2024, 11:31 PMqr
03/27/2024, 11:34 PMconswagga
03/27/2024, 11:35 PMqr
03/27/2024, 11:36 PMqr
03/27/2024, 11:36 PMconswagga
03/27/2024, 11:36 PMqr
03/27/2024, 11:37 PMqr
03/27/2024, 11:37 PMqr
03/27/2024, 11:40 PMif(!Master)
{
Send to master
}
Else //master
{
Gather
}
//Wait for completion aka Mpi::waitAll()???
If(master)
{
If (OS.open)
{
....
}
}
qr
03/27/2024, 11:42 PMqr
03/27/2024, 11:43 PMotaolafr
03/28/2024, 7:20 AMotaolafr
03/28/2024, 8:03 AM